From 13d1861034fdfc095f537b228a14943a95e4cef4 Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Thu, 12 Apr 2018 19:03:54 +0100 Subject: [PATCH] Appease -Werror=maybe-uninitialized before calling strtok_r() --- bin/named/statschannel.c | 4 +++- lib/irs/getaddrinfo.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c index 42d87a0352..8e89196fcf 100644 --- a/bin/named/statschannel.c +++ b/bin/named/statschannel.c @@ -3122,10 +3122,12 @@ render_xsl(const char *url, isc_httpdurl_t *urlinfo, const char *if_modified_since = "If-Modified-Since: "; _headers = strdup(headers); + saveptr = NULL; for (line = strtok_r(_headers, "\n", &saveptr); line; line = strtok_r(NULL, "\n", &saveptr)) { - if (strncasecmp(line, if_modified_since, strlen(if_modified_since)) == 0) { + if (strncasecmp(line, if_modified_since, + strlen(if_modified_since)) == 0) { time_t t1, t2; line += strlen(if_modified_since); result = isc_time_parsehttptimestamp(line, &when); diff --git a/lib/irs/getaddrinfo.c b/lib/irs/getaddrinfo.c index f3172543f1..ed62c391b6 100644 --- a/lib/irs/getaddrinfo.c +++ b/lib/irs/getaddrinfo.c @@ -1070,6 +1070,7 @@ set_order(int family, int (**net_order)(const char *, int, struct addrinfo **, } else { order = getenv("NET_ORDER"); found = 0; + last = NULL; for (tok = strtok_r(order, ":", &last); tok; tok = strtok_r(NULL, ":", &last))