From 5061687867ee9ae90b23469d7d6ac7f4c9c8424c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 20 May 2016 15:23:05 +0100 Subject: store toolbar config in standard options instead of a separate file --- utils/nsoption.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'utils/nsoption.c') diff --git a/utils/nsoption.c b/utils/nsoption.c index 387d7c704..7e7766622 100644 --- a/utils/nsoption.c +++ b/utils/nsoption.c @@ -38,6 +38,9 @@ #include "utils/utils.h" #include "utils/nsoption.h" +/** Length of buffer used to read lines from input file */ +#define NSOPTION_MAX_LINE_LEN 1024 + struct nsoption_s *nsoptions = NULL; struct nsoption_s *nsoptions_default = NULL; @@ -597,11 +600,12 @@ nserror nsoption_finalise(struct nsoption_s *opts, struct nsoption_s *defs) return NSERROR_OK; } + /* exported interface documented in utils/nsoption.h */ nserror nsoption_read(const char *path, struct nsoption_s *opts) { - char s[100]; + char s[NSOPTION_MAX_LINE_LEN]; FILE *fp; struct nsoption_s *defs; @@ -625,7 +629,7 @@ nsoption_read(const char *path, struct nsoption_s *opts) LOG("Successfully opened '%s' for Options file", path); - while (fgets(s, 100, fp)) { + while (fgets(s, NSOPTION_MAX_LINE_LEN, fp)) { char *colon, *value; unsigned int idx; -- cgit v1.2.3