improved the speed somewhat

fixed bug with negative chars in comparisons
This commit is contained in:
eck
1990-08-28 13:54:46 +00:00
parent cd1f6c38a4
commit a41c51783a
17 changed files with 104 additions and 85 deletions

View File

@@ -7,13 +7,15 @@
#include <string.h>
void *
memset(void *s, int c, register size_t n)
memset(void *s, register int c, register size_t n)
{
register char *s1 = s;
while (n > 0) {
n--;
*s1++ = c;
if (n>0) {
n++;
while (--n > 0) {
*s1++ = c;
}
}
return s;
}