Browse Source

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>
Natanael Copa 14 years ago
parent
commit
c7c7ea92be
1 changed files with 1 additions and 2 deletions
  1. 1 2
      libc/misc/internals/parse_config.c

+ 1 - 2
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) */