diff options
-rw-r--r-- | config.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -130,7 +130,7 @@ config *parse_config(const char *filename) { return NULL; } - cfg = malloc(sizeof(config)); + cfg = calloc(1, sizeof(config)); /* Return NULL, if cfg wasn't allocated. */ if (cfg == NULL) { @@ -138,8 +138,6 @@ config *parse_config(const char *filename) { return NULL; } - memset(cfg, 0, sizeof(config)); - while (*tmp != '\0') { char *line = get_line(&tmp); char *value; |