From 474058f3fc0102ea4ff7d1fcd8ab5e86ae916126 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sun, 6 Mar 2016 13:44:59 +0100 Subject: [PATCH] curl_json plugin: zero-initialize struct correctly Seen on FreeBSD: curl_json.c: In function 'cj_sock_perform': curl_json.c:864:10: warning: missing initializer for field 'sun_len' of 'struct sockaddr_un' [-Wmissing-field-initializers] struct sockaddr_un sa_unix = {}; ^ In file included from curl_json.c:32:0: /usr/include/sys/un.h:48:16: note: 'sun_len' declared here unsigned char sun_len; /* sockaddr len including null */ ^ --- src/curl_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/curl_json.c b/src/curl_json.c index 556263f6..45898c3e 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -861,7 +861,7 @@ static void cj_submit (cj_t *db, cj_key_t *key, value_t *value) /* {{{ */ static int cj_sock_perform (cj_t *db) /* {{{ */ { char errbuf[1024]; - struct sockaddr_un sa_unix = {}; + struct sockaddr_un sa_unix = { 0 }; sa_unix.sun_family = AF_UNIX; sstrncpy (sa_unix.sun_path, db->sock, sizeof (sa_unix.sun_path)); -- 2.30.2