aboutsummaryrefslogtreecommitdiffstats
path: root/labs.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2019-11-01 22:06:40 +0100
committerMattias Andrée <maandree@kth.se>2019-11-01 22:06:40 +0100
commitc57844b08bced71778f38f2346464c3e0836287c (patch)
treee3733b4c99818ee6c77ed3d4d37becf30f92268f /labs.c
parentUse installed liberror (diff)
downloadliberror-libc-c57844b08bced71778f38f2346464c3e0836287c.tar.gz
liberror-libc-c57844b08bced71778f38f2346464c3e0836287c.tar.bz2
liberror-libc-c57844b08bced71778f38f2346464c3e0836287c.tar.xz
Add some functions and add functions with _failed suffix
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'labs.c')
-rw-r--r--labs.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/labs.c b/labs.c
index 7e1ea0a..2a5f050 100644
--- a/labs.c
+++ b/labs.c
@@ -2,6 +2,16 @@
#include "internal.h"
+void
+liberror_labs_failed(long int i)
+{
+ liberror_set_error_errno("The absolute value of largest negative integer "
+ "cannot be represented as a signed integer",
+ "labs", EOVERFLOW);
+ (void) i;
+}
+
+
long int
liberror_labs(long int i)
{
@@ -11,9 +21,7 @@ liberror_labs(long int i)
if (i != LONG_MIN)
return labs(i);
liberror_save_backtrace(NULL);
- liberror_set_error_errno("The absolute value of largest negative integer "
- "cannot be represented as a signed integer",
- "labs", EOVERFLOW);
+ liberror_labs_failed(i);
return i;
#endif
}