]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_edict.c
fix stupid bug in \n and \r parsing
[xonotic/darkplaces.git] / prvm_edict.c
index fea28867e094e3c2f401eb2f82df61f1a43edf8e..c6d5d77c184a2a51b3ca1ede61b992632e7d3bc2 100644 (file)
@@ -931,12 +931,12 @@ qboolean PRVM_ED_ParseEpair(prvm_edict_t *ent, ddef_t *key, const char *s, qbool
                val->string = PRVM_AllocString(l, &new_p);
                for (i = 0;i < l;i++)
                {
-                       if (s[i] == '\\' && i < l-1 && s[i] == 'n' && parsebackslash)
+                       if (s[i] == '\\' && s[i+1] == 'n' && parsebackslash)
                        {
                                i++;
                                *new_p++ = '\n';
                        }
-                       else if (s[i] == '\\' && i < l-1 && s[i] == 'r' && parsebackslash)
+                       else if (s[i] == '\\' && s[i+1] == 'r' && parsebackslash)
                        {
                                i++;
                                *new_p++ = '\r';