From 1118911981c4ee56b90328c04dda14935b3d5525 Mon Sep 17 00:00:00 2001 From: sin Date: Tue, 3 Mar 2015 16:59:33 +0000 Subject: Don't trap on error for vsprintf() and friends --- include/stdio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/stdio.h') diff --git a/include/stdio.h b/include/stdio.h index 94025ef..83ddb88 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -54,7 +54,7 @@ __fortify_vsprintf(char *s, const char *fmt, __builtin_va_list ap) if (bos != -1) { r = vsnprintf(s, bos, fmt, ap); - if (r == -1 || (size_t)r >= bos) + if (r != -1 && (size_t)r >= bos) __builtin_trap(); } else { r = vsprintf(s, fmt, ap); @@ -102,7 +102,7 @@ __fortify_vsnprintf(char *s, size_t n, const char *fmt, __builtin_va_list ap) int r; \ if (bos != -1) { \ r = (snprintf)(s, bos, fmt, ## __VA_ARGS__); \ - if (r == -1 || (size_t)r >= bos) \ + if (r != -1 && (size_t)r >= bos) \ __builtin_trap(); \ } else { \ r = (sprintf)(s, fmt, ## __VA_ARGS__); \ -- cgit v1.3