summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-05-20 15:23:05 +0100
committerVincent Sanders <vince@kyllikki.org>2016-05-21 12:17:49 +0100
commit5061687867ee9ae90b23469d7d6ac7f4c9c8424c (patch)
tree9d0a92f4bd65cd53a985b052cff4d751abc5ac11 /utils
parenta47a6dd52e92e75ebf11e125563fb953dd1cab8b (diff)
downloadnetsurf-5061687867ee9ae90b23469d7d6ac7f4c9c8424c.tar.gz
netsurf-5061687867ee9ae90b23469d7d6ac7f4c9c8424c.tar.bz2
store toolbar config in standard options instead of a separate file
Diffstat (limited to 'utils')
-rw-r--r--utils/nsoption.c8
1 files changed, 6 insertions, 2 deletions
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;