From 8c2dc5ccec7c6726b5414a2b62a596f0531d0463 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 16 Nov 2015 23:01:22 +0100 Subject: add macros for overflow check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/slibc-human/escape.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/slibc-human') diff --git a/src/slibc-human/escape.c b/src/slibc-human/escape.c index a7de84b..56cf794 100644 --- a/src/slibc-human/escape.c +++ b/src/slibc-human/escape.c @@ -16,6 +16,7 @@ * along with this program. If not, see . */ #include +#include #include #include #include @@ -80,8 +81,7 @@ char* escape(const char* restrict str, char quote) return strdup(str); len = strlen(str) * sizeof(char); - if (__builtin_uaddl_overflow(len, extra * sizeof(char), &size)) - return errno = ENOMEM, NULL; + MEM_OVERFLOW(uaddl, len, extra * sizeof(char), &size); w = rc = malloc(size); if (rc == NULL) -- cgit v1.2.3-70-g09d2