diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-20 17:50:58 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-07-20 17:50:58 +0000 |
commit | 9b366f41367f717d8ddd9909fdc710b92f92a16c (patch) | |
tree | 8f84f7271f312b8658e0443ea723c20fcd1eb36f /libbb/parse_config.c | |
parent | a34f1ed737e79e494904706e59f4e7fbb49e32b3 (diff) | |
download | busybox-w32-9b366f41367f717d8ddd9909fdc710b92f92a16c.tar.gz busybox-w32-9b366f41367f717d8ddd9909fdc710b92f92a16c.tar.bz2 busybox-w32-9b366f41367f717d8ddd9909fdc710b92f92a16c.zip |
libbb/parse_config.c: fix small buglet (by Vladimir)
Diffstat (limited to 'libbb/parse_config.c')
-rw-r--r-- | libbb/parse_config.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libbb/parse_config.c b/libbb/parse_config.c index 68caa2c37..3174a649e 100644 --- a/libbb/parse_config.c +++ b/libbb/parse_config.c | |||
@@ -199,7 +199,8 @@ int FAST_FUNC config_read(parser_t *parser, char **tokens, unsigned flags, const | |||
199 | } else { | 199 | } else { |
200 | // vanilla token. cut the line at the first delim | 200 | // vanilla token. cut the line at the first delim |
201 | q = line + strcspn(line, delims); | 201 | q = line + strcspn(line, delims); |
202 | *q++ = '\0'; | 202 | if (*q) // watch out: do not step past the line end! |
203 | *q++ = '\0'; | ||
203 | } | 204 | } |
204 | // pin token | 205 | // pin token |
205 | if ((flags & (PARSE_DONT_REDUCE|PARSE_DONT_TRIM)) || *line) { | 206 | if ((flags & (PARSE_DONT_REDUCE|PARSE_DONT_TRIM)) || *line) { |
@@ -207,6 +208,7 @@ int FAST_FUNC config_read(parser_t *parser, char **tokens, unsigned flags, const | |||
207 | tokens[ii++] = line; | 208 | tokens[ii++] = line; |
208 | } | 209 | } |
209 | line = q; | 210 | line = q; |
211 | //bb_info_msg("A[%s]", line); | ||
210 | } | 212 | } |
211 | 213 | ||
212 | if (ii < mintokens) | 214 | if (ii < mintokens) |