From ca83de0ec92b56c712f7a7376b21a1a1337b3107 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Thu, 26 Jul 2012 11:56:00 -0400 Subject: Document the parser interface and remove some excessive readdir paranoia. --- io.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 6cfc3efe..05e87907 100644 --- a/io.c +++ b/io.c @@ -3036,7 +3036,7 @@ find_longest_terminator: return REC_OK; } -/* get_a_record --- read a record from IOP into out, return length of EOF, set RT */ +/* get_a_record --- read a record from IOP into out, return length of EOF, set RT. Note that errcode is never NULL, and the caller initializes *errcode to 0. */ static int get_a_record(char **out, /* pointer to pointer to data */ @@ -3071,8 +3071,7 @@ get_a_record(char **out, /* pointer to pointer to data */ return EOF; } else if (iop->count == -1) { iop->flag |= IOP_AT_EOF; - if (errcode != NULL) - *errcode = errno; + *errcode = errno; return EOF; } else { iop->dataend = iop->buf + iop->count; -- cgit v1.2.3