diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2021-06-18 09:36:15 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2021-06-18 09:36:15 -0400 |
commit | dc9f35b35a7d7fd6e831f3ee287d1e7ad96e684e (patch) | |
tree | 6307bcc4b2463d9f078c88267436ac9f20b2c558 /config.c | |
parent | b245b752bbfa02b2d3c86c8c3dca7920aaa351b1 (diff) |
Replace all instances of `malloc()` with `calloc()`
in `config.c`.
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -63,8 +63,7 @@ char *get_line(char **str) { for (i = 0; tmp[i] != '\n' && tmp[i] != '\0'; i++); - s = malloc(i+1); - memset(s, 0, i+1); + s = calloc(i+1, sizeof(char)); memcpy(s, *str, i); *str += (i+1); @@ -73,7 +72,7 @@ char *get_line(char **str) { char *make_str(const char *str) { const size_t length = strlen(str); - char *s = malloc(length+1); + char *s = calloc(length+1, sizeof(char)); memcpy(s, str, length+1); return s; } |