aboutsummaryrefslogtreecommitdiffstats
path: root/src/slibc-human
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-11-16 23:01:22 +0100
committerMattias Andrée <maandree@operamail.com>2015-11-16 23:01:22 +0100
commit8c2dc5ccec7c6726b5414a2b62a596f0531d0463 (patch)
treeb21f10236c933f9c79a2904f967fe3337fd06205 /src/slibc-human
parentincrease readability (diff)
downloadslibc-8c2dc5ccec7c6726b5414a2b62a596f0531d0463.tar.gz
slibc-8c2dc5ccec7c6726b5414a2b62a596f0531d0463.tar.bz2
slibc-8c2dc5ccec7c6726b5414a2b62a596f0531d0463.tar.xz
add macros for overflow check
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/slibc-human/escape.c4
1 files changed, 2 insertions, 2 deletions
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 <http://www.gnu.org/licenses/>.
*/
#include <slib-human.h>
+#include <slibc/internals.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@@ -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)