aboutsummaryrefslogtreecommitdiffstats
path: root/abs.c
diff options
context:
space:
mode:
Diffstat (limited to 'abs.c')
-rw-r--r--abs.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/abs.c b/abs.c
index 71d73b5..feac9a7 100644
--- a/abs.c
+++ b/abs.c
@@ -2,6 +2,16 @@
#include "internal.h"
+void
+liberror_abs_failed(int i)
+{
+ liberror_set_error_errno("The absolute value of largest negative integer "
+ "cannot be represented as a signed integer",
+ "abs", EOVERFLOW);
+ (void) i;
+}
+
+
int
liberror_abs(int i)
{
@@ -11,9 +21,7 @@ liberror_abs(int i)
if (i != INT_MIN)
return abs(i);
liberror_save_backtrace(NULL);
- liberror_set_error_errno("The absolute value of largest negative integer "
- "cannot be represented as a signed integer",
- "abs", EOVERFLOW);
+ liberror_abs_failed(i);
return i;
#endif
}