OSDN Git Service
(root)
/
android-x86
/
bionic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9bcb91a
)
Correct generic memset implementation
author
Chris Dearman
<chris@mips.com>
Fri, 5 Feb 2010 23:13:55 +0000
(15:13 -0800)
committer
Dan Hazon
<dan@mips.com>
Fri, 5 Feb 2010 23:13:55 +0000
(15:13 -0800)
Signed-off-by: Chris Dearman <chris@mips.com>
libc/string/memset.c
patch
|
blob
|
history
diff --git
a/libc/string/memset.c
b/libc/string/memset.c
index
ed9cdd7
..
41dafb2
100644
(file)
--- 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;