diff options
author | Yousong Zhou <yszhou4tech@gmail.com> | 2015-05-25 20:32:42 +0800 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-05-25 23:03:21 +0200 |
commit | 4b52bdbdbec3c84afeab5c3167e69f7c6012b2f3 (patch) | |
tree | 0ddb49fdc093fc25a0e4ffcd83531cff1e8d5956 | |
parent | 19e29ffc15dbd958e8e6a648ee0982c68353516f (diff) | |
download | uci-4b52bdbdbec3c84afeab5c3167e69f7c6012b2f3.tar.gz |
file.c: lift the 4096 bytes line length limit.
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
-rw-r--r-- | file.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -33,7 +33,6 @@ #include "uci_internal.h" #define LINEBUF 32 -#define LINEBUF_MAX 4096 /* * Fetch a new line from the input stream and resize buffer if necessary @@ -69,11 +68,10 @@ __private void uci_getln(struct uci_context *ctx, int offset) return; } - if (pctx->bufsz > LINEBUF_MAX/2) - uci_parse_error(ctx, "line too long"); - pctx->bufsz *= 2; pctx->buf = uci_realloc(ctx, pctx->buf, pctx->bufsz); + if (!pctx->buf) + UCI_THROW(ctx, UCI_ERR_MEM); } while (1); } |