]> git.sur5r.net Git - i3/i3/blobdiff - src/config_parser.c
Merge pull request #3430 from Synray/aspect_ratio
[i3/i3] / src / config_parser.c
index 4e66c91109f3f8f37d0dfddbeacc2da6545cb23c..2d3f3bb919eb2d134baa61f9e510880275fd8210 100644 (file)
@@ -743,7 +743,7 @@ static char *migrate_config(char *input, off_t size) {
 
     /* read the script’s output */
     int conv_size = 65535;
-    char *converted = smalloc(conv_size);
+    char *converted = scalloc(conv_size, 1);
     int read_bytes = 0, ret;
     do {
         if (read_bytes == conv_size) {
@@ -1065,7 +1065,7 @@ bool parse_file(const char *f, bool use_nagbar) {
     int version = detect_version(buf);
     if (version == 3) {
         /* We need to convert this v3 configuration */
-        char *converted = migrate_config(new, stbuf.st_size);
+        char *converted = migrate_config(new, strlen(new));
         if (converted != NULL) {
             ELOG("\n");
             ELOG("****************************************************************\n");