From: Mark Andrews Date: Thu, 16 Aug 2012 21:20:19 +0000 (+1000) Subject: silence "t_names.c:130:7: warning: The left expression of the compound assignment... X-Git-Tag: v9.7.7rc1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8a68fec6da8cba2c5b94621be61428eb8f68d93;p=thirdparty%2Fbind9.git silence "t_names.c:130:7: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage" --- diff --git a/bin/tests/names/t_names.c b/bin/tests/names/t_names.c index 82e537be4a2..a9d45a7c1de 100644 --- a/bin/tests/names/t_names.c +++ b/bin/tests/names/t_names.c @@ -121,20 +121,30 @@ chkdata(unsigned char *buf, size_t buflen, char *exp_data, if (('0' <= *q) && (*q <= '9')) *p = *q - '0'; - else if (('a' <= *q) && (*q <= 'z')) + else if (('a' <= *q) && (*q <= 'f')) *p = *q - 'a' + 10; - else if (('A' <= *q) && (*q <= 'Z')) + else if (('A' <= *q) && (*q <= 'F')) *p = *q - 'A' + 10; + else { + t_info("malformed comparison data\n"); + free(data); + return (-1); + } ++q; *p <<= 4; if (('0' <= *q) && (*q <= '9')) *p |= ((*q - '0') & 0x0f); - else if (('a' <= *q) && (*q <= 'z')) + else if (('a' <= *q) && (*q <= 'f')) *p |= ((*q - 'a' + 10) & 0x0f); - else if (('A' <= *q) && (*q <= 'Z')) + else if (('A' <= *q) && (*q <= 'F')) *p |= ((*q - 'A' + 10) & 0x0f); + else { + t_info("malformed comparison data\n"); + free(data); + return (-1); + } ++p; ++q; ++cnt; @@ -203,9 +213,9 @@ getmsg(char *datafile_name, unsigned char *buf, int buflen, isc_buffer_t *pbuf) } if (('0' <= c) && (c <= '9')) val = c - '0'; - else if (('a' <= c) && (c <= 'z')) + else if (('a' <= c) && (c <= 'f')) val = c - 'a' + 10; - else if (('A' <= c) && (c <= 'Z')) + else if (('A' <= c) && (c <= 'F')) val = c - 'A'+ 10; else { (void)fclose(fp);