From 1d09a7d5785198a132e4056ced68e19141392ad3 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 28 Jun 2015 18:13:06 -0500 Subject: [PATCH] Fix abs() being used for long int in l_precomp.c --- code/botlib/l_precomp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/botlib/l_precomp.c b/code/botlib/l_precomp.c index e0438e89..c0870dbe 100644 --- a/code/botlib/l_precomp.c +++ b/code/botlib/l_precomp.c @@ -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); @@ -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