From e393f848e8e45ccb1acb9cebf47d6d7d3bc88c15 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 17 Jul 2013 22:49:00 +0200 Subject: [PATCH] bugfix #497: Test for EOF correctly --- Changelog | 1 + drill/drill_util.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) 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') { -- 2.47.3