]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - filematch.c
added vid_grabkeyboard cvar which defaults to 0, this means that the glx client no...
[xonotic/darkplaces.git] / filematch.c
index f6d85790d0d5baffe90f7f2f5c5c1eab68708281..0837136f7e36bcea5d6d8821a5bec224d58070ef 100644 (file)
@@ -61,10 +61,13 @@ int matchpattern(const char *in, const char *pattern, int caseinsensitive)
 stringlist_t *stringlistappend(stringlist_t *current, char *text)
 {
        stringlist_t *newitem;
-       newitem = (stringlist_t *)Z_Malloc(strlen(text) + 1 + sizeof(stringlist_t));
+       size_t textlen;
+
+       textlen = strlen(text) + 1;
+       newitem = (stringlist_t *)Z_Malloc(textlen + sizeof(stringlist_t));
        newitem->next = NULL;
        newitem->text = (char *)(newitem + 1);
-       strcpy(newitem->text, text);
+       memcpy(newitem->text, text, textlen);
        if (current)
                current->next = newitem;
        return newitem;