summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
authorNatanael Copa <natanael.copa@gmail.com>2010-10-14 06:35:06 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-10-14 14:59:58 +0200
commitc7c7ea92be00a9b5b48d1243bb75d32390263159 (patch)
treeac80bda781b61d17beb371b9ebbebd5bc2bcb254 /libc/misc
parent5cb23c3c734fad8fcfcd09eef34f666f04a0af5e (diff)
config parser: always initialize line pointer
We must always initialize line pointer since data pointer might have changed due to a realloc (in getserv.c for example). Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/internals/parse_config.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libc/misc/internals/parse_config.c b/libc/misc/internals/parse_config.c
index 6734f35f4..6d3b6f4a0 100644
--- a/libc/misc/internals/parse_config.c
+++ b/libc/misc/internals/parse_config.c
@@ -192,8 +192,7 @@ again:
return 0;
parser->allocated |= 1;
} /* else { assert(parser->data_len > 0); } */
- if (parser->line == NULL)
- parser->line = parser->data + parser->data_len;
+ parser->line = parser->data + parser->data_len;
/*config_free_data(parser);*/
/* Read one line (handling continuations with backslash) */