pr_edict.c (ED_ParseEpair): remove a developer.value check before the Con_Dwarning call added by r1527

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1528 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2017-11-10 05:55:04 +00:00
parent 78970b5323
commit c5b2c6a848

View file

@ -771,7 +771,7 @@ Can parse either fields or globals
returns false if error
=============
*/
static qboolean ED_ParseEpair (void *base, ddef_t *key, const char *s)
static qboolean ED_ParseEpair (void *base, ddef_t *key, const char *s)
{
int i;
char string[128];
@ -798,7 +798,7 @@ static qboolean ED_ParseEpair (void *base, ddef_t *key, const char *s)
end = (char *)string + strlen(string);
v = string;
w = string;
for (i = 0; i < 3 && (w <= end); i++) // ericw -- added (w <= end) check
{
// set `v` to the next space (or 0 byte), and change that char to a 0 byte
@ -808,12 +808,11 @@ static qboolean ED_ParseEpair (void *base, ddef_t *key, const char *s)
((float *)d)[i] = atof (w);
w = v = v+1;
}
// ericw -- fill remaining elements to 0.0f in case we hit the end of string before reading 3 floats
// ericw -- fill remaining elements to 0.0f in case we hit the end of string before reading 3 floats
if (i < 3)
{
if (developer.value)
Con_DWarning("vanilla will read garbage for \"%s\" \"%s\"\n", PR_GetString(key->s_name), s);
Con_DWarning("vanilla will read garbage for \"%s\" \"%s\"\n", PR_GetString(key->s_name), s);
for (; i < 3; i++)
((float *)d)[i] = 0.0f;
}