aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 95fe0f0..5078c01 100644
--- a/utils.c
+++ b/utils.c
@@ -167,6 +167,8 @@ char *readfile(int fd)
if (len >= capacity)
buf = realloc(buf, sizeof(char)*(capacity *= 2));
}
+ buf[len] = '\0';
+ close(fd);
return &buf[1];
}