summaryrefslogtreecommitdiffstats
path: root/libc/misc/internals/parse_config.c
Commit message (Collapse)AuthorAgeFilesLines
* parse_config: discard rest of incomplete lineNatanael Copa2010-10-141-0/+7
| | | | | | | | If line is longer then size of given buffer and buffer is not allocated by the config parser itself, then discard rest of line. Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* config parser: always initialize line pointerNatanael Copa2010-10-141-2/+1
| | | | | | | | 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>
* config parser: do not assume that realloc return same pointerNatanael Copa2010-10-141-5/+4
| | | | | | | | | | | | We need to update the parser->line pointer on realloc and do not initialize the token array til after the potensial realloc in bb_get_chunk_with_continuation(). While here, also replace a realloc() with malloc() where pointer always is NULL. Signed-off-by: Natanael Copa <natanael.copa@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* misc: Fix build error about missing PAGE_SIZEAbdoulaye Walsimou Gaye2010-09-061-0/+1
| | | | | | | | | | | | | | | | This patch fixes the following build error: CC libc/misc/internals/__h_errno_location.os CC libc/misc/internals/parse_config.os libc/misc/internals/parse_config.c: In function 'bb_get_chunk_with_continuation': libc/misc/internals/parse_config.c:77: error: 'PAGE_SIZE' undeclared (first use in this function) libc/misc/internals/parse_config.c:77: error: (Each undeclared identifier is reported only once libc/misc/internals/parse_config.c:77: error: for each function it appears in.) make[2]: *** [libc/misc/internals/parse_config.os] Error 1 Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* getserv: fix reading services lines w > 80 charsBernhard Reutner-Fischer2010-08-191-4/+7
| | | | | | e.g. getservbyname() Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* config parser: fix memory corruptionTimo Teräs2010-08-061-2/+2
| | | | | | | | | | | | fgets will happily write over allocated area limits. Adjusted the buffer size according to how much is already read. Also increase the maximum default line length, as 80 is slightly small. It might be better if bb_get_chunk_with_continuation would reallocate the line buffer if it was not user given. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* add config parserBernhard Reutner-Fischer2010-08-051-0/+268
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>