summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/unistd.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/unistd.h b/include/unistd.h
index a2b3105..a73279b 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -177,7 +177,7 @@ _FORTIFY_FN(swab) void swab(const void * _FORTIFY_POS0 __os,
177 size_t __bs = __bos(__os, 0); 177 size_t __bs = __bos(__os, 0);
178 size_t __bd = __bos(__od, 0); 178 size_t __bd = __bos(__od, 0);
179 179
180 if ((size_t)__n > __bs || (size_t)__n > __bd) 180 if (__n > 0 && ((size_t)__n > __bs || (size_t)__n > __bd))
181 __builtin_trap(); 181 __builtin_trap();
182 return __orig_swab(__os, __od, __n); 182 return __orig_swab(__os, __od, __n);
183} 183}