From 92495a70bc18fe4e5c6e56789d42eb3744998865 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Thu, 27 Jan 2011 11:13:39 +0000 Subject: [PATCH] Fix compiler warnings (#4887) --- code/qcommon/vm_x86_64_assembler.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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;