diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-11-18 07:34:33 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-11-18 07:34:33 +0100 |
commit | c487f0da07799446ce468ee2e9dd2ac8d24f9a8a (patch) | |
tree | 1084f90b55ea1d1ea07507e288210d26e1c6c0f8 /src/string | |
parent | implement additional string.h and wchar.h functions (diff) | |
download | slibc-c487f0da07799446ce468ee2e9dd2ac8d24f9a8a.tar.gz slibc-c487f0da07799446ce468ee2e9dd2ac8d24f9a8a.tar.bz2 slibc-c487f0da07799446ce468ee2e9dd2ac8d24f9a8a.tar.xz |
fix errors
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/string/strn/stpncpy.c | 2 | ||||
-rw-r--r-- | src/string/strn/stpnmove.c | 2 | ||||
-rw-r--r-- | src/string/strn/strcncpy.c | 2 | ||||
-rw-r--r-- | src/string/strn/strcnmove.c | 2 | ||||
-rw-r--r-- | src/string/strn/strncpy.c | 2 | ||||
-rw-r--r-- | src/string/strn/strnmove.c | 2 | ||||
-rw-r--r-- | src/string/strn/strstrncpy.c | 2 | ||||
-rw-r--r-- | src/string/strn/strstrnmove.c | 2 |
8 files changed, 8 insertions, 8 deletions
diff --git a/src/string/strn/stpncpy.c b/src/string/strn/stpncpy.c index 876eaf0..4290dab 100644 --- a/src/string/strn/stpncpy.c +++ b/src/string/strn/stpncpy.c @@ -40,7 +40,7 @@ char* stpncpy(char* restrict whither, const char* restrict whence, size_t maxlen { size_t n = strnlen(whence, maxlen); memcpy(whither, whence, n); - memset(whither, 0, maxlen - n); + memset(whither + n, 0, maxlen - n); return whither + n; } diff --git a/src/string/strn/stpnmove.c b/src/string/strn/stpnmove.c index a0a0de9..917b753 100644 --- a/src/string/strn/stpnmove.c +++ b/src/string/strn/stpnmove.c @@ -41,7 +41,7 @@ char* stpnmove(char* whither, const char* whence, size_t maxlen) { size_t n = strnlen(whence, maxlen); memmove(whither, whence, n); - memset(whither, 0, maxlen - n); + memset(whither + n, 0, maxlen - n); return whither + n; } diff --git a/src/string/strn/strcncpy.c b/src/string/strn/strcncpy.c index 5036c7d..594e7df 100644 --- a/src/string/strn/strcncpy.c +++ b/src/string/strn/strcncpy.c @@ -48,7 +48,7 @@ char* strcncpy(char* restrict whither, const char* restrict whence, int c, size_ size_t n = stop == NULL ? strnlen(whence, maxlen) : (size_t)(stop - whence); char* r = stop == NULL ? NULL : (whither + n); memcpy(whither, whence, n); - memset(whither, 0, maxlen - n); + memset(whither + n, 0, maxlen - n); return r; } diff --git a/src/string/strn/strcnmove.c b/src/string/strn/strcnmove.c index f418e92..5fbdf19 100644 --- a/src/string/strn/strcnmove.c +++ b/src/string/strn/strcnmove.c @@ -48,7 +48,7 @@ char* strcnmove(char* whither, const char* whence, int c, size_t maxlen) size_t n = stop == NULL ? strnlen(whence, maxlen) : (size_t)(stop - whence); char* r = stop == NULL ? NULL : (whither + n); memmove(whither, whence, n); - memset(whither, 0, maxlen - n); + memset(whither + n, 0, maxlen - n); return r; } diff --git a/src/string/strn/strncpy.c b/src/string/strn/strncpy.c index f3eba84..3a1e66b 100644 --- a/src/string/strn/strncpy.c +++ b/src/string/strn/strncpy.c @@ -37,7 +37,7 @@ char* strncpy(char* restrict whither, const char* restrict whence, size_t maxlen { size_t n = strnlen(whence, maxlen); memcpy(whither, whence, n); - memset(whither, 0, maxlen - n); + memset(whither + n, 0, maxlen - n); return whither; } diff --git a/src/string/strn/strnmove.c b/src/string/strn/strnmove.c index a8b3224..0d22c15 100644 --- a/src/string/strn/strnmove.c +++ b/src/string/strn/strnmove.c @@ -39,7 +39,7 @@ char* strnmove(char* whither, const char* whence, size_t maxlen) { size_t n = strnlen(whence, maxlen); memmove(whither, whence, n); - memset(whither, 0, maxlen - n); + memset(whither + n, 0, maxlen - n); return whither; } diff --git a/src/string/strn/strstrncpy.c b/src/string/strn/strstrncpy.c index 0beb8ec..43b58fe 100644 --- a/src/string/strn/strstrncpy.c +++ b/src/string/strn/strstrncpy.c @@ -49,7 +49,7 @@ char* strstrncpy(char* restrict whither, const char* restrict whence, size_t n = stop == NULL ? strnlen(whence, maxlen) : (size_t)(stop - whence); char* r = stop == NULL ? NULL : (whither + n); memcpy(whither, whence, n); - memset(whither, 0, maxlen - n); + memset(whither + n, 0, maxlen - n); return r; } diff --git a/src/string/strn/strstrnmove.c b/src/string/strn/strstrnmove.c index 9bec614..d1c63f9 100644 --- a/src/string/strn/strstrnmove.c +++ b/src/string/strn/strstrnmove.c @@ -48,7 +48,7 @@ char* strstrnmove(char* whither, const char* whence, const char* restrict str, s size_t n = stop == NULL ? strnlen(whence, maxlen) : (size_t)(stop - whence); char* r = stop == NULL ? NULL : (whither + n); memmove(whither, whence, n); - memset(whither, 0, maxlen - n); + memset(whither + n, 0, maxlen - n); return r; } |