]> git.sur5r.net Git - i3/i3/blobdiff - src/config_parser.c
scalloc parse_config input to make sure it terminates with '\0'
[i3/i3] / src / config_parser.c
index c88e9d1e3c2e7919b277f95b9eabf4e2d8885654..58a5552ceb27d77d7f267004cf457a636c902fe1 100644 (file)
@@ -1025,7 +1025,7 @@ bool parse_file(const char *f, bool use_nagbar) {
     /* Then, allocate a new buffer and copy the file over to the new one,
      * but replace occurrences of our variables */
     char *walk = buf, *destwalk;
-    char *new = smalloc(stbuf.st_size + extra_bytes + 1);
+    char *new = scalloc(stbuf.st_size + extra_bytes + 1, 1);
     destwalk = new;
     while (walk < (buf + stbuf.st_size)) {
         /* Find the next variable */