diff --git a/code/qcommon/vm_x86_64_assembler.c b/code/qcommon/vm_x86_64_assembler.c index 1771284c..0ae4f1c1 100644 --- a/code/qcommon/vm_x86_64_assembler.c +++ b/code/qcommon/vm_x86_64_assembler.c @@ -20,6 +20,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA =========================================================================== */ +#define _ISOC99_SOURCE + +#include "vm_local.h" #include #include #include @@ -238,9 +241,15 @@ static void hash_add_label(const char* label, unsigned address) { struct hashentry* h; unsigned i = hashkey(label, -1U); + int labellen; + i %= sizeof(labelhash)/sizeof(labelhash[0]); h = malloc(sizeof(struct hashentry)); - h->label = strdup(label); + + labellen = strlen(label); + h->label = malloc(labellen); + Com_sprintf(h->label, labellen, "%s", label); + h->address = address; h->next = labelhash[i]; labelhash[i] = h;