summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cfg.c12
-rw-r--r--cfg.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/cfg.c b/cfg.c
index ddfd113..910ce48 100644
--- a/cfg.c
+++ b/cfg.c
@@ -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++;
diff --git a/cfg.h b/cfg.h
index 8a993cd..d7ddb93 100644
--- a/cfg.h
+++ b/cfg.h
@@ -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);