summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2021-06-18 09:36:15 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2021-06-18 09:36:15 -0400
commitdc9f35b35a7d7fd6e831f3ee287d1e7ad96e684e (patch)
tree6307bcc4b2463d9f078c88267436ac9f20b2c558 /config.c
parentb245b752bbfa02b2d3c86c8c3dca7920aaa351b1 (diff)
Replace all instances of `malloc()` with `calloc()`
in `config.c`.
Diffstat (limited to 'config.c')
-rw-r--r--config.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/config.c b/config.c
index d2c0ea4..129d44d 100644
--- a/config.c
+++ b/config.c
@@ -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;
}