From: Wouter Wijngaards Date: Fri, 26 May 2017 06:50:48 +0000 (+0000) Subject: - Fix #1270: unitauth.c doesn't compile with higher warning level X-Git-Tag: release-1.6.4rc1~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6538b82928580f99861ac79e9a3600079f00eb98;p=thirdparty%2Funbound.git - Fix #1270: unitauth.c doesn't compile with higher warning level and optimization git-svn-id: file:///svn/unbound/trunk@4191 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 19983ac5d..24f874dbb 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,7 @@ +26 May 2017: Wouter + - Fix #1270: unitauth.c doesn't compile with higher warning level + and optimization + 24 May 2017: Wouter - authzone cname chain, no rrset duplicates, wildcard doesn't change rrsets added for cname chain. diff --git a/testcode/unitauth.c b/testcode/unitauth.c index 0aa1fa04c..f6c022aa0 100644 --- a/testcode/unitauth.c +++ b/testcode/unitauth.c @@ -543,9 +543,12 @@ checkfile(char* f1, char *f2) if(!i2) fatal_exit("cannot open %s: %s", f2, strerror(errno)); while(!feof(i1) && !feof(i2)) { + char* cp1, *cp2; line++; - (void)fgets(buf1, (int)sizeof(buf1), i1); - (void)fgets(buf2, (int)sizeof(buf2), i2); + cp1 = fgets(buf1, (int)sizeof(buf1), i1); + cp2 = fgets(buf2, (int)sizeof(buf2), i2); + if((!cp1 && !feof(i1)) || (!cp2 && !feof(i2))) + fatal_exit("fgets failed: %s", strerror(errno)); if(strcmp(buf1, buf2) != 0) { log_info("in files %s and %s:%d", f1, f2, line); log_info("'%s'", buf1);