From: Willem Toorop Date: Wed, 17 Jul 2013 20:49:00 +0000 (+0200) Subject: bugfix #497: Test for EOF correctly X-Git-Tag: release-1.6.17rc1~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e393f848e8e45ccb1acb9cebf47d6d7d3bc88c15;p=thirdparty%2Fldns.git bugfix #497: Test for EOF correctly --- diff --git a/Changelog b/Changelog index f7a777e9..abbf21f9 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 1.6.17 + * bugfix #497: Properly test for EOF when reading key files with drill. * bugfix #504: GPOS RR has three rdata fields. Thanks Jelte Jansen. * -u and -U parameter for ldns-read-zone to mark/unmark a RR type for printing as unknown type diff --git a/drill/drill_util.c b/drill/drill_util.c index db0433e7..9cf90a50 100644 --- a/drill/drill_util.c +++ b/drill/drill_util.c @@ -17,10 +17,10 @@ static int read_line(FILE *input, char *line, size_t len) { int i; - - char c; + int c; + for (i = 0; i < (int)len-1; i++) { - c = (char)getc(input); + c = getc(input); if (c == EOF) { return -1; } else if (c != '\n') {