From ee1149fb375eaba76655fa77fa181899066eeed0 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sun, 27 Mar 2016 13:21:47 -0700 Subject: [PATCH] Fix failing tests for stringlib --- src/string.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/string.c b/src/string.c index 4121acf..f08b742 100644 --- a/src/string.c +++ b/src/string.c @@ -21,7 +21,7 @@ void *memset(void *s, int c, size_t n) if ( s == NULL ) { return NULL; } - while ( ((int)d - (int)s) <= n ) { + while ( (d - (int *)s) <= n ) { *d = c; d += sizeof(int); } @@ -59,7 +59,6 @@ int strncat(char *dest, char *src, size_t n) int strcmp(char *s1, char *s2) { - int d = 0; int s1len = 0; if ( s1 == NULL || s2 == NULL ) {