From: Ruben Kerkhof Date: Sun, 6 Mar 2016 12:44:59 +0000 (+0100) Subject: curl_json plugin: zero-initialize struct correctly X-Git-Tag: collectd-5.6.0~398 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=474058f3fc0102ea4ff7d1fcd8ab5e86ae916126;p=collectd.git 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 */ ^ --- 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));