From 60376287eb7a9ca1118b6a0cb30fe749beda7f48 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 22 Sep 2010 03:15:07 +0000 Subject: 2010-09-21 Craig Howland * libc/string/memcpy.c: Do not assign size_t parameter to int. Use parameter directly, instead. * libc/string/memccpy.c: Likewise. * libc/string/mempcpy.c: Likewise. * libc/string/memmove.c: Likewise. --- newlib/libc/string/memccpy.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'newlib/libc/string/memccpy.c') diff --git a/newlib/libc/string/memccpy.c b/newlib/libc/string/memccpy.c index f677ac02e..a6f45e8b3 100644 --- a/newlib/libc/string/memccpy.c +++ b/newlib/libc/string/memccpy.c @@ -92,12 +92,11 @@ _DEFUN (memccpy, (dst0, src0, endchar, len0), _CONST char *src = src0; long *aligned_dst; _CONST long *aligned_src; - int len = len0; char endchar = endchar0 & 0xff; /* If the size is small, or either SRC or DST is unaligned, then punt into the byte copy loop. This should be rare. */ - if (!TOO_SMALL(len) && !UNALIGNED (src, dst)) + if (!TOO_SMALL(len0) && !UNALIGNED (src, dst)) { int i; unsigned long mask = 0; @@ -116,14 +115,14 @@ _DEFUN (memccpy, (dst0, src0, endchar, len0), /* Copy one long word at a time if possible. */ - while (len >= LITTLEBLOCKSIZE) + while (len0 >= LITTLEBLOCKSIZE) { unsigned long buffer = (unsigned long)(*aligned_src); buffer ^= mask; if (DETECTNULL (buffer)) break; /* endchar is found, go byte by byte from here */ *aligned_dst++ = *aligned_src++; - len -= LITTLEBLOCKSIZE; + len0 -= LITTLEBLOCKSIZE; } /* Pick up any residual with a byte copier. */ @@ -131,7 +130,7 @@ _DEFUN (memccpy, (dst0, src0, endchar, len0), src = (char*)aligned_src; } - while (len--) + while (len0--) { if ((*dst++ = *src++) == endchar) { -- cgit v1.2.3