diff options
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1,14 +1,13 @@ #include "types.h" -#include "x86.h" void* memset(void *dst, int c, uint n) { - if ((uint64)dst%4 == 0 && n%4 == 0){ - c &= 0xFF; - stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4); - } else - stosb(dst, c, n); + char *cdst = (char *) dst; + int i; + for(i = 0; i < n; i++){ + cdst[i] = c; + } return dst; } |