summaryrefslogtreecommitdiffhomepage
path: root/libbb/parse_config.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-07-16 23:04:49 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-07-16 23:04:49 +0000
commitfb1642f2caa3690cb40f603fca22eeace09a0bfa (patch)
tree0ae2f20765b93696322e8c6c5e928b0b1be2cbee /libbb/parse_config.c
parentc01340fe26b76e172805ff641ad9af6bc45cdc91 (diff)
fix up callsites of config_read to check for >= 0
Diffstat (limited to 'libbb/parse_config.c')
-rw-r--r--libbb/parse_config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libbb/parse_config.c b/libbb/parse_config.c
index e63204b09..f07099285 100644
--- a/libbb/parse_config.c
+++ b/libbb/parse_config.c
@@ -19,7 +19,7 @@ Typical usage:
// open file
if (config_open(filename, &p)) {
// parse line-by-line
- while (*config_read(&p, t, 3, 0, delimiters, comment_char)) { // 0..3 tokens
+ while (*config_read(&p, t, 3, 0, delimiters, comment_char) >= 0) { // 0..3 tokens
// use tokens
bb_error_msg("TOKENS: [%s][%s][%s]", t[0], t[1], t[2]);
}
@@ -77,7 +77,7 @@ int FAST_FUNC config_read(parser_t *parser, char **tokens, int ntokens, int mint
//TODO: speed up xmalloc_fgetline by internally using fgets, not fgetc
line = xmalloc_fgetline(parser->fp);
if (!line)
- return line;
+ return -1;
parser->lineno++;
// handle continuations. Tito's code stolen :)