]> git.saurik.com Git - apple/libc.git/blame - string/FreeBSD/swab.c.patch
Libc-391.tar.gz
[apple/libc.git] / string / FreeBSD / swab.c.patch
CommitLineData
3d9156a7
A
1--- swab.c.orig 2004-08-03 14:33:13.000000000 -0700
2+++ swab.c 2004-08-03 15:05:03.000000000 -0700
3@@ -43,12 +43,14 @@
4 #include <string.h>
5
6 void
7-swab(const void * __restrict from, void * __restrict to, size_t len)
8+swab(const void * __restrict from, void * __restrict to, ssize_t len)
9 {
10 unsigned long temp;
11 int n;
12 char *fp, *tp;
13
14+ if (len <= 0)
15+ return;
16 n = len >> 1;
17 fp = (char *)from;
18 tp = (char *)to;