]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - csprogs.c
Replaced all calls to str[n]cat and strncpy by calls to strlcat and strlcpy respectively
[xonotic/darkplaces.git] / csprogs.c
index f6758470c34f3fc3738a0e85c573f2fe5a1d3664..3309a5f4b552e9f835222d8f13b3cf32fe908a01 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -414,10 +414,10 @@ void CSQC_AddPrintText (const char *msg)
                        csqc_printtextbuf[0] = 0;
                }
                else
-                       strcat(csqc_printtextbuf, msg);
+                       strlcat(csqc_printtextbuf, msg, CSQC_PRINTBUFFERLEN);
                return;
        }
-       strcat(csqc_printtextbuf, msg);
+       strlcat(csqc_printtextbuf, msg, CSQC_PRINTBUFFERLEN);
        CL_VM_Parse_Print(csqc_printtextbuf);
        csqc_printtextbuf[0] = 0;
 }
@@ -512,11 +512,18 @@ void CL_VM_Init (void)
                return;
        }
        else
+       {
+               if (developer.integer < 100)
+               {
+                       Con_DPrintf("CL_VM_Init: CSQC is broken, and is not being loaded because developer is less than 100.\n");
+                       return;
+               }
                if(!sv.active && !csqc_progcrc.integer) //[515]: because cheaters may use csqc while server didn't allowed it !
                {
                        Con_Printf("CL_VM_Init: server didn't sent CSQC crc, so CSQC is disabled\n");
                        return;
                }
+       }
 
        PRVM_Begin;
        PRVM_InitProg(PRVM_CLIENTPROG);