From: Adam Heath Date: Thu, 29 Aug 2002 19:28:16 +0000 (+0000) Subject: Check for eof before we getc(), not after. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=948bf54c8b2af1b9b4351b4804be09b53f757fa4;p=dpkg Check for eof before we getc(), not after. --- diff --git a/ChangeLog b/ChangeLog index 7493186b..3bb5186f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu Aug 29 14:31:22 CDT 2002 Adam Heath + + * lib/parse.c: Check for eof before we getc(), not after. + Sat Aug 24 15:36:41 CDT 2002 Adam Heath * scripts/install-info.pl: Previous install-infos(before 1.10) handled diff --git a/lib/parse.c b/lib/parse.c index 7133d923..1e84f948 100644 --- a/lib/parse.c +++ b/lib/parse.c @@ -172,8 +172,8 @@ int parsedb(const char *filename, enum parsedbflags flags, for (;;) { if (c == '\n' || c == MSDOS_EOF_CHAR) { lno++; - c= getc_mmap(dataptr); if (EOF_mmap(dataptr, endptr)) break; + c= getc_mmap(dataptr); /* Found double eol, or start of new field */ if (EOF_mmap(dataptr, endptr) || c == '\n' || !isspace(c)) break; ungetc_mmap(c,dataptr, data);