Skip to content

Commit

Permalink
Fix abs() being used for long int in l_precomp.c
Browse files Browse the repository at this point in the history
  • Loading branch information
zturtleman committed Jun 28, 2015
1 parent 70eb1fa commit 1d09a7d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions code/botlib/l_precomp.c
Expand Up @@ -2445,7 +2445,7 @@ int PC_Directive_eval(source_t *source)
token.whitespace_p = source->scriptstack->script_p;
token.endwhitespace_p = source->scriptstack->script_p;
token.linescrossed = 0;
sprintf(token.string, "%d", abs(value));
sprintf(token.string, "%ld", labs(value));
token.type = TT_NUMBER;
token.subtype = TT_INTEGER|TT_LONG|TT_DECIMAL;
PC_UnreadSourceToken(source, &token);
Expand Down Expand Up @@ -2550,12 +2550,12 @@ int PC_DollarDirective_evalint(source_t *source)
token.whitespace_p = source->scriptstack->script_p;
token.endwhitespace_p = source->scriptstack->script_p;
token.linescrossed = 0;
sprintf(token.string, "%d", abs(value));
sprintf(token.string, "%ld", labs(value));
token.type = TT_NUMBER;
token.subtype = TT_INTEGER|TT_LONG|TT_DECIMAL;

#ifdef NUMBERVALUE
token.intvalue = abs(value);
token.intvalue = labs(value);
token.floatvalue = token.intvalue;
#endif //NUMBERVALUE

Expand Down

0 comments on commit 1d09a7d

Please sign in to comment.