From 2ec1959fd1016a18ef3b2d154ce7076be8f237e4 Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Fri, 31 May 2019 09:45:59 -0400 Subject: fork/wait/exit work --- string.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'string.c') 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; } -- cgit v1.2.3