projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update ctype data to unicode 12.1.0
[musl]
/
src
/
string
/
memset.c
diff --git
a/src/string/memset.c
b/src/string/memset.c
index
f438b07
..
5613a14
100644
(file)
--- a/
src/string/memset.c
+++ b/
src/string/memset.c
@@
-11,12
+11,16
@@
void *memset(void *dest, int c, size_t n)
* offsets are well-defined and in the dest region. */
if (!n) return dest;
* offsets are well-defined and in the dest region. */
if (!n) return dest;
- s[0] = s[n-1] = c;
+ s[0] = c;
+ s[n-1] = c;
if (n <= 2) return dest;
if (n <= 2) return dest;
- s[1] = s[n-2] = c;
- s[2] = s[n-3] = c;
+ s[1] = c;
+ s[2] = c;
+ s[n-2] = c;
+ s[n-3] = c;
if (n <= 6) return dest;
if (n <= 6) return dest;
- s[3] = s[n-4] = c;
+ s[3] = c;
+ s[n-4] = c;
if (n <= 8) return dest;
/* Advance pointer to align it at a 4-byte boundary,
if (n <= 8) return dest;
/* Advance pointer to align it at a 4-byte boundary,