]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
MSG_ReadString: if hitting the max length of the string, continue to read until NUL...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 13 Jun 2011 07:10:08 +0000 (07:10 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 13 Jun 2011 17:25:45 +0000 (19:25 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11195 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=7c586d061e7308e0e8164827fa0e14b470921d67

common.c

index 8e9bf40a40f8273e4476faabdc0fd802c4ffa514..5539b0aff0adfd752d3302eededaacada4bb1fa7 100644 (file)
--- a/common.c
+++ b/common.c
@@ -496,6 +496,9 @@ char *MSG_ReadString (void)
        int l,c;
        for (l = 0;l < (int) sizeof(string) - 1 && (c = MSG_ReadByte()) != -1 && c != 0;l++)
                string[l] = c;
+       // read the rest of the string anyway
+       while(c != -1 && c != 0)
+               c = MSG_ReadByte();
        string[l] = 0;
        return string;
 }