In ED_ParseField() replace atof() with strtof().

On most implementations atof() is just a wrapper around strtod().
Calling strtof() saves one cast. For the sake of cinsistency change
atoi() to (int)strtol(), it's a noop. Reported by maraakate in yquake2
issue #160.
This commit is contained in:
Yamagi Burmeister 2016-12-17 10:18:06 +01:00
parent c61bff46d7
commit f4002456b4

View file

@ -487,13 +487,13 @@ ED_ParseField(const char *key, const char *value, edict_t *ent)
((float *)(b + f->ofs))[2] = vec[2];
break;
case F_INT:
*(int *)(b + f->ofs) = atoi(value);
*(int *)(b + f->ofs) = (int)strtol(value, (char **)NULL, 10);
break;
case F_FLOAT:
*(float *)(b + f->ofs) = atof(value);
*(float *)(b + f->ofs) = strtof(value, (char **)NULL);;
break;
case F_ANGLEHACK:
v = atof(value);
v = strtof(value, (char **)NULL);;
((float *)(b + f->ofs))[0] = 0;
((float *)(b + f->ofs))[1] = v;
((float *)(b + f->ofs))[2] = 0;