summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/string.c b/string.c
index 861ea25..d99e612 100644
--- a/string.c
+++ b/string.c
@@ -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;
}