about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xatxec.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/atxec.c b/atxec.c
index f1bdf7e..b40fd74 100755
--- a/atxec.c
+++ b/atxec.c
@@ -102,7 +102,7 @@ file_splice(char *file)
 
 	fstat(fileno(f), &st);
 
-	s = malloc(st.st_size + 1);
+	s = calloc(1, st.st_size + 1);
 	if (!s) {
 		fclose(f);
 		return;
@@ -110,8 +110,6 @@ file_splice(char *file)
 	fread(s, 1, st.st_size, f);
 	fclose(f);
 
-	s[st.st_size] = 0;
-
 	arg_splice(s);
 
 	/* leak string, args points into it! */