From ac044784a6ce64ff15610d4b70750065a7f01b80 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 1 Sep 2015 21:07:54 +0200 Subject: start on makefile and fixing warnings and errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/wchar/wcscpy.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/wchar/wcscpy.c') diff --git a/src/wchar/wcscpy.c b/src/wchar/wcscpy.c index 7d75a98..37b8ed4 100644 --- a/src/wchar/wcscpy.c +++ b/src/wchar/wcscpy.c @@ -16,7 +16,6 @@ * along with this program. If not, see . */ #include -#include @@ -67,9 +66,9 @@ wchar_t* wcpcpy(wchar_t* restrict whither, const wchar_t* restrict whence) * one character passed the last written non-NUL * character. */ -wchar_t* wcsccpy(wchar_t* restrict whither, const wchar_t* restrict whence, wchat_t c) +wchar_t* wcsccpy(wchar_t* restrict whither, const wchar_t* restrict whence, wchar_t c) { - wchar_t* r = wmemccopy(whither, whence, c, wcslen(whence) + 1); + wchar_t* r = wmemccpy(whither, whence, c, wcslen(whence) + 1); if (r) *r = 0; return r; @@ -96,7 +95,7 @@ wchar_t* wcswcscpy(wchar_t* restrict whither, const wchar_t* restrict whence, co { const wchar_t* stop = str == NULL ? NULL : wcsstr(whence, str); size_t n = stop == NULL ? wcslen(whence) : (size_t)(stop - whence); - wchar_t* r = stop == NULL ? NULL ? whither + n; + wchar_t* r = stop == NULL ? NULL : (whither + n); wmemcpy(whither, whence, n); whither[n] = 0; return r; @@ -176,11 +175,11 @@ wchar_t* wcpncpy(wchar_t* restrict whither, const wchar_t* restrict whence, size * one character passed the last written non-NUL * character. */ -wchar_t* wcscncpy(wchar_t* restrict whither, const wchar_t* restrict whence, wchat_t c, size_t maxlen) +wchar_t* wcscncpy(wchar_t* restrict whither, const wchar_t* restrict whence, wchar_t c, size_t maxlen) { - const char* stop = wmemchr(whence, c, maxlen); + const wchar_t* stop = wmemchr(whence, c, maxlen); size_t n = stop == NULL ? wcsnlen(whence, maxlen) : (size_t)(stop - whence); - char* r = stop == NULL ? NULL : (whither + n); + wchar_t* r = stop == NULL ? NULL : (whither + n); wmemcpy(whither, whence, n); wmemset(whither, 0, maxlen - n); return r; @@ -213,9 +212,9 @@ wchar_t* wcscncpy(wchar_t* restrict whither, const wchar_t* restrict whence, wch wchar_t* wcswcsncpy(wchar_t* restrict whither, const wchar_t* restrict whence, const wchar_t* restrict str, size_t maxlen) { - const char* stop = wcsnstr(whence, str, maxlen); + const wchar_t* stop = wcsnstr(whence, str, maxlen); size_t n = stop == NULL ? wcsnlen(whence, maxlen) : (size_t)(stop - whence); - char* r = stop == NULL ? NULL : (whither + n); + wchar_t* r = stop == NULL ? NULL : (whither + n); wmemcpy(whither, whence, n); wmemset(whither, 0, maxlen - n); return r; -- cgit v1.2.3-70-g09d2