projects
/
project
/
uci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
file.c: lift the 4096 bytes line length limit.
[project/uci.git]
/
file.c
diff --git
a/file.c
b/file.c
index 81047a48352ddbb836d55c7a01611fd2cd5adce5..cf0dfafc1cccb1e379bcb2653e13f4875b149692 100644
(file)
--- a/
file.c
+++ b/
file.c
@@
-33,7
+33,6
@@
#include "uci_internal.h"
#define LINEBUF 32
#include "uci_internal.h"
#define LINEBUF 32
-#define LINEBUF_MAX 4096
/*
* Fetch a new line from the input stream and resize buffer if necessary
/*
* 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;
}
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);
pctx->bufsz *= 2;
pctx->buf = uci_realloc(ctx, pctx->buf, pctx->bufsz);
+ if (!pctx->buf)
+ UCI_THROW(ctx, UCI_ERR_MEM);
} while (1);
}
} while (1);
}