Replace wcsncpy with lstrcpynW / memcpy as appropriate.
Modified: trunk/reactos/lib/kernel32/misc/profile.c
_____
Modified: trunk/reactos/lib/kernel32/misc/profile.c
--- trunk/reactos/lib/kernel32/misc/profile.c 2005-08-21 15:51:57 UTC
(rev 17464)
+++ trunk/reactos/lib/kernel32/misc/profile.c 2005-08-21 15:54:48 UTC
(rev 17465)
@@ -24,7 +24,6 @@
#define NDEBUG
#include "../include/debug.h"
-
static const char bom_utf8[] = {0xEF,0xBB,0xBF};
typedef enum
@@ -122,9 +121,7 @@
quote = *value++;
}
- wcsncpy( buffer, value, len );
- if (quote && ((size_t)len >= wcslen(value)))
- buffer[wcslen(buffer) - 1] = '\0';
+ lstrcpynW( buffer, value, len );
}
@@ -963,7 +960,7 @@
{
if (f > 0)
{
- wcsncpy(buf, section->name, f - 1);
+ memcpy(buf, section->name, (f - 1) *
sizeof(WCHAR));
buf += f - 1;
*buf++ = '\0';
}
@@ -1158,13 +1155,13 @@
break;
}
- if (*p == ' ') /* ouch, contained trailing ' ' */
- {
+ if (*p == ' ') /* ouch, contained trailing ' ' */
+ {
int len = (int)(p - def_val);
LPWSTR p;
p = HeapAlloc(GetProcessHeap(), 0, (len + 1) *
sizeof(WCHAR));
- wcsncpy(p, def_val, len);
+ memcpy(p, def_val, len * sizeof(WCHAR));
p[len] = '\0';
pDefVal = p;
}
@@ -1185,7 +1182,7 @@
}
else
{
- wcsncpy( buffer, pDefVal, len );
+ lstrcpynW( buffer, pDefVal, len );
ret = wcslen( buffer );
}