diff options
author | daniel-Jones <daniel@danieljon.es> | 2018-10-15 14:41:00 +1030 |
---|---|---|
committer | daniel-Jones <daniel@danieljon.es> | 2018-10-15 14:41:00 +1030 |
commit | 559d998d93ac13bfb782147aa6d98d79790c4753 (patch) | |
tree | 78df07aa64ffdd3006c7634c7c224e64cba6399f | |
parent | 66655d2d17e4ca8463cf61b356ed8d233ddde162 (diff) | |
download | cfg-master.tar.gz cfg-master.zip |
-rw-r--r-- | cfg.c | 12 | ||||
-rw-r--r-- | cfg.h | 2 |
2 files changed, 7 insertions, 7 deletions
@@ -78,7 +78,7 @@ cfggetvalue(struct cfgfile *cfg, char *key, char *buffer, size_t buffersize) } void -appendchar(char *dest, char ch) +cfgappendchar(char *dest, char ch) { /* * appends char ch to dest @@ -117,7 +117,7 @@ readfile(struct cfgfile *cfg, FILE *fp) if (!buffer) return 0; } - appendchar(buffer, ch); + cfgappendchar(buffer, ch); linesize += sizeof(char); } else @@ -182,8 +182,8 @@ parseline(char *line, struct cfgfile *cfg) int c = 0; int doingkey = 1; size_t keybufsize = 1; - size_t keysize = 30; - size_t valbufsize = 30; + size_t keysize = 255; + size_t valbufsize = 255; size_t valsize = 0; tmp->key = malloc(keybufsize); tmp->value = malloc(valbufsize); @@ -204,7 +204,7 @@ parseline(char *line, struct cfgfile *cfg) if (!tmp->key) return 0; } - appendchar(tmp->key, ch); + cfgappendchar(tmp->key, ch); valsize += sizeof(char); } } @@ -217,7 +217,7 @@ parseline(char *line, struct cfgfile *cfg) if (!tmp->value) return 0; } - appendchar(tmp->value, ch); + cfgappendchar(tmp->value, ch); valsize += sizeof(char); } c++; @@ -42,7 +42,7 @@ int cfggetvalue(struct cfgfile *cfg, char *key, char *buffer, size_t buffersize); void -appendchar(char *dest, char ch); +cfgappendchar(char *dest, char ch); int readfile(struct cfgfile *cfg, FILE *fp); |