Fix several warnings with gcc-5 and an error with mingw (where
[xonotic/darkplaces.git] / prvm_edict.c
index bc6c5ad..a002fd4 100644 (file)
@@ -3105,7 +3105,11 @@ int PRVM_AllocString(prvm_prog_t *prog, size_t bufferlength, char **pointer)
 {
        int i;
        if (!bufferlength)
+       {
+               if (pointer)
+                       *pointer = NULL;
                return 0;
+       }
        for (i = prog->firstfreeknownstring;i < prog->numknownstrings;i++)
                if (!prog->knownstrings[i])
                        break;