summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorChris Dearman <chris@mips.com>2010-02-05 15:13:55 -0800
committerDan Hazon <dan@mips.com>2010-02-05 15:13:55 -0800
commitbdc6e3c83f70db35603260d5c1baa8097cb765fe (patch)
tree5876d8cb021bbd72508dea2c3c5426512011f685 /libc
parent9bcb91a212ab4b9bd5892f4cf3adda6a549b8fbc (diff)
downloadbionic-bdc6e3c83f70db35603260d5c1baa8097cb765fe.zip
bionic-bdc6e3c83f70db35603260d5c1baa8097cb765fe.tar.gz
bionic-bdc6e3c83f70db35603260d5c1baa8097cb765fe.tar.bz2
Correct generic memset implementation
Signed-off-by: Chris Dearman <chris@mips.com>
Diffstat (limited to 'libc')
-rw-r--r--libc/string/memset.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libc/string/memset.c b/libc/string/memset.c
index ed9cdd7..41dafb2 100644
--- a/libc/string/memset.c
+++ b/libc/string/memset.c
@@ -34,10 +34,10 @@ void* memset(void* dst, int c, size_t n)
char* end = q + n;
for (;;) {
- if (q < end) break; *q++ = (char) c;
- if (q < end) break; *q++ = (char) c;
- if (q < end) break; *q++ = (char) c;
- if (q < end) break; *q++ = (char) c;
+ if (q >= end) break; *q++ = (char) c;
+ if (q >= end) break; *q++ = (char) c;
+ if (q >= end) break; *q++ = (char) c;
+ if (q >= end) break; *q++ = (char) c;
}
return dst;