-/*
+/* $Id$
+ *
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/rtl/wstring.c
{
wchar_t *t = wsToFill;
int i = 0;
- while( *wsToFill != 0 && i < sizeMaxFill)
+ while( *wsToFill != 0 && i < (int) sizeMaxFill)
{
*wsToFill = wcFill;
wsToFill++;
return NULL;
}
-#ifndef LIBCAPTIVE
-
int wcscmp(const wchar_t *cs, const wchar_t *ct)
{
while (*cs != '\0' && *ct != '\0' && *cs == *ct)
return *cs - *ct;
}
-#endif /* LIBCAPTIVE */
-
wchar_t* wcscpy(wchar_t* str1, const wchar_t* str2)
{
wchar_t* s = str1;
- DPRINT("wcscpy(str1 %S, str2 %S)\n",str1,str2);
+ /* Never dump 'str1' here as it can crash due to unitialized memory access (no end-terminator). */
+ DPRINT("wcscpy(str1 <undef>, str2 %S)\n",str2);
while ((*str2)!=0)
{
*s = *str2;
wchar_t * wcsncat(wchar_t *dest, const wchar_t *src, size_t count)
{
- int i, j;
+ unsigned int i, j;
for (j = 0; dest[j] != 0; j++)
;
wchar_t *wcsncpy(wchar_t *dest, const wchar_t *src, size_t count)
{
- int i;
+ unsigned int i;
for (i = 0; i < count; i++)
{
return dest;
}
}
- dest[i] = 0;
return dest;
}