From: Roy Marples Date: Wed, 5 Jun 2013 17:19:07 +0000 (+0000) Subject: Silence bogus gcc messages. X-Git-Tag: v6.0.0~51 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b340cfc9b9f2d0bbb62eb51324b01abfa7b709e0;p=thirdparty%2Fdhcpcd.git Silence bogus gcc messages. --- diff --git a/dhcp-common.c b/dhcp-common.c index d8c5ae62..7b217f94 100644 --- a/dhcp-common.c +++ b/dhcp-common.c @@ -99,10 +99,15 @@ encode_rfc1035(const char *src, uint8_t *dst) if (src == NULL || *src == '\0') return 0; + if (dst) { p = dst; lp = p++; } + /* Silence bogus GCC warnings */ + else + p = lp = NULL; + len = 1; has_dot = 0; for (; *src; src++) { @@ -123,13 +128,16 @@ encode_rfc1035(const char *src, uint8_t *dst) *p++ = (uint8_t)*src; len++; } + if (dst) { *lp = p - lp - 1; if (has_dot) *p++ = '\0'; } + if (has_dot) len++; + return len; } diff --git a/dhcp6.c b/dhcp6.c index b0fe4393..ecff6e2d 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -362,7 +362,7 @@ dhcp6_makemessage(struct interface *ifp) uint8_t IA, *p; uint32_t u32; const struct ipv6_addr *ap; - const char *hostname; + const char *hostname = NULL; /* assignment just to appease GCC*/ state = D6_STATE(ifp); if (state->send) {