Hopefully fix https://github.com/fte-team/fteqw/issues/275 though the specified input is still optimised too much for this usage to be useful.

This commit is contained in:
Shpoike 2024-09-17 03:27:17 +01:00
parent a1bf9dd60a
commit 6f579815d2

View file

@ -843,7 +843,7 @@ int DecompileReadData(const char *srcfilename, char *buf, size_t bufsize)
}
QC_snprintfz(name, sizeof(name), "function%i", i);
name[strlen(name)] = 0;
p = malloc(strlen(name + 1));
p = malloc(strlen(name) + 1);
strcpy(p, name);
functions[i].s_name = (char *)p - strings;
}