From f4002456b4b31a3958748521e39b96128710974d Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Sat, 17 Dec 2016 10:18:06 +0100 Subject: [PATCH] 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. --- src/g_spawn.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/g_spawn.c b/src/g_spawn.c index 9e3781b..a59fb48 100644 --- a/src/g_spawn.c +++ b/src/g_spawn.c @@ -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;