projects
/
reactos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sync with trunk r46493
[reactos.git]
/
dll
/
win32
/
shlwapi
/
string.c
diff --git
a/dll/win32/shlwapi/string.c
b/dll/win32/shlwapi/string.c
index
cfb59ea
..
e00a925
100644
(file)
--- a/
dll/win32/shlwapi/string.c
+++ b/
dll/win32/shlwapi/string.c
@@
-507,22
+507,32
@@
LPWSTR WINAPI StrCpyW(LPWSTR lpszStr, LPCWSTR lpszSrc)
* Copy a string to another string, up to a maximum number of characters.
*
* PARAMS
* Copy a string to another string, up to a maximum number of characters.
*
* PARAMS
- *
lpszStr
[O] Destination string
- *
lpszSrc
[I] Source string
- *
iLen
[I] Maximum number of chars to copy
+ *
dst
[O] Destination string
+ *
src
[I] Source string
+ *
count
[I] Maximum number of chars to copy
*
* RETURNS
*
* RETURNS
- *
lpszStr
.
+ *
dst
.
*/
*/
-LPWSTR WINAPI StrCpyNW(LPWSTR
lpszStr, LPCWSTR lpszSrc, int iLen
)
+LPWSTR WINAPI StrCpyNW(LPWSTR
dst, LPCWSTR src, int count
)
{
{
- TRACE("(%p,%s,%i)\n", lpszStr, debugstr_w(lpszSrc), iLen);
+ LPWSTR d = dst;
+ LPCWSTR s = src;
- lstrcpynW(lpszStr, lpszSrc, iLen);
- return lpszStr;
-}
+ TRACE("(%p,%s,%i)\n", dst, debugstr_w(src), count);
+ if (s)
+ {
+ while ((count > 1) && *s)
+ {
+ count--;
+ *d++ = *s++;
+ }
+ }
+ if (count) *d = 0;
+ return dst;
+}
/*************************************************************************
* SHLWAPI_StrStrHelperA
/*************************************************************************
* SHLWAPI_StrStrHelperA