From 393592573cd69c18e12928b7f9c627657901cc3c Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 24 Mar 2004 14:45:17 +0000 Subject: [PATCH] (readtokens0): Return true on success rather than on failure. All callers changed. This also happens to fix a portability bug on pre-C99 hosts, where (bool) INTEGER sometimes returns false even when INTEGER is nonzero. --- lib/readtokens0.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/readtokens0.c b/lib/readtokens0.c index db638a71c4..b46ba8f854 100644 --- a/lib/readtokens0.c +++ b/lib/readtokens0.c @@ -60,7 +60,7 @@ save_token (struct Tokens *t) /* Read NUL-separated tokens from stream IN into T until EOF or error. The final NUL is optional. Always append a NULL pointer to the resulting list of token pointers, but that pointer isn't counted - via t->n_tok. */ + via t->n_tok. Return true if successful. */ bool readtokens0 (FILE *in, struct Tokens *t) { @@ -94,5 +94,5 @@ readtokens0 (FILE *in, struct Tokens *t) t->tok = obstack_finish (&t->o_tok); t->tok_len = obstack_finish (&t->o_tok_len); - return ferror (in); + return ! ferror (in); } -- 2.47.2