From 6f579815d2e7bdb8102eb8b2e5c6445226176f9c Mon Sep 17 00:00:00 2001 From: Shpoike Date: Tue, 17 Sep 2024 03:27:17 +0100 Subject: [PATCH] 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. --- engine/qclib/decomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/qclib/decomp.c b/engine/qclib/decomp.c index dbd11a9d8..85879138a 100644 --- a/engine/qclib/decomp.c +++ b/engine/qclib/decomp.c @@ -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; }