From 144faa8ea505158d2d8a3fd9bbe58addefd05077 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 13 Nov 2018 14:33:41 +0900 Subject: [PATCH] sd-ndisc: use structured initializer at one more place --- src/libsystemd-network/sd-ndisc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libsystemd-network/sd-ndisc.c b/src/libsystemd-network/sd-ndisc.c index b2fd087987b..6715f72d340 100644 --- a/src/libsystemd-network/sd-ndisc.c +++ b/src/libsystemd-network/sd-ndisc.c @@ -136,12 +136,14 @@ _public_ int sd_ndisc_new(sd_ndisc **ret) { assert_return(ret, -EINVAL); - nd = new0(sd_ndisc, 1); + nd = new(sd_ndisc, 1); if (!nd) return -ENOMEM; - nd->n_ref = 1; - nd->fd = -1; + *nd = (sd_ndisc) { + .n_ref = 1, + .fd = -1, + }; *ret = TAKE_PTR(nd); -- 2.47.3