Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6e3bcb5a
Commit
6e3bcb5a
authored
Apr 18, 2005
by
Peter Berg Larsen
Committed by
Alexandre Julliard
Apr 18, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace strncpy with memcpy or lstrcpyn.
parent
71be0944
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
89 additions
and
75 deletions
+89
-75
tooltips.c
dlls/comctl32/tooltips.c
+1
-1
filedlg.c
dlls/commdlg/filedlg.c
+1
-1
parsedisplayname.c
dlls/devenum/parsedisplayname.c
+5
-3
band.c
dlls/dmband/band.c
+3
-3
chordmap.c
dlls/dmcompos/chordmap.c
+3
-3
audiopath.c
dlls/dmime/audiopath.c
+3
-3
graph.c
dlls/dmime/graph.c
+3
-3
segment.c
dlls/dmime/segment.c
+3
-3
loaderstream.c
dlls/dmloader/loaderstream.c
+1
-1
script.c
dlls/dmscript/script.c
+3
-3
style.c
dlls/dmstyle/style.c
+3
-3
font.c
dlls/gdi/font.c
+1
-1
freetype.c
dlls/gdi/freetype.c
+5
-5
chm_lib.c
dlls/itss/chm_lib.c
+1
-1
cond.y
dlls/msi/cond.y
+1
-1
locale.c
dlls/msvcrt/locale.c
+7
-7
mciwnd.c
dlls/msvideo/mciwnd.c
+2
-2
msvideo16.c
dlls/msvideo/msvideo16.c
+5
-3
insobjdlg.c
dlls/oledlg/insobjdlg.c
+1
-1
filtermapper.c
dlls/quartz/filtermapper.c
+1
-1
debughlp.c
dlls/shell32/debughlp.c
+2
-2
shelllink.c
dlls/shell32/shelllink.c
+1
-1
shellpath.c
dlls/shell32/shellpath.c
+5
-5
shlexec.c
dlls/shell32/shlexec.c
+2
-2
systray.c
dlls/shell32/systray.c
+1
-2
edit.c
dlls/user/edit.c
+8
-6
int21.c
dlls/winedos/int21.c
+1
-1
dialogs.c
dlls/wininet/dialogs.c
+1
-1
internet.c
dlls/wininet/internet.c
+8
-1
utility.c
dlls/wininet/utility.c
+1
-0
audio.c
dlls/winmm/wineoss/audio.c
+1
-1
drivedetect.c
programs/winecfg/drivedetect.c
+1
-1
sfnt2fnt.c
tools/sfnt2fnt.c
+4
-3
No files found.
dlls/comctl32/tooltips.c
View file @
6e3bcb5a
...
...
@@ -387,7 +387,7 @@ static void TOOLTIPS_GetDispInfoW(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO
else
if
(
ttnmdi
.
lpszText
!=
LPSTR_TEXTCALLBACKW
)
{
INT
max_len
=
(
ttnmdi
.
lpszText
==
&
ttnmdi
.
szText
[
0
])
?
sizeof
(
ttnmdi
.
szText
)
/
sizeof
(
ttnmdi
.
szText
[
0
])
:
INFOTIPSIZE
-
1
;
strncpy
W
(
infoPtr
->
szTipText
,
ttnmdi
.
lpszText
,
max_len
);
lstrcpyn
W
(
infoPtr
->
szTipText
,
ttnmdi
.
lpszText
,
max_len
);
if
(
ttnmdi
.
uFlags
&
TTF_DI_SETITEM
)
{
INT
len
=
max
(
strlenW
(
ttnmdi
.
lpszText
),
max_len
);
toolPtr
->
hinst
=
0
;
...
...
dlls/commdlg/filedlg.c
View file @
6e3bcb5a
...
...
@@ -2065,7 +2065,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
if
(
fodInfos
->
unicode
)
{
LPOPENFILENAMEW
ofn
=
fodInfos
->
ofnInfos
;
strncpy
W
(
ofn
->
lpstrFileTitle
,
lpstrFileTitle
,
ofn
->
nMaxFileTitle
);
lstrcpyn
W
(
ofn
->
lpstrFileTitle
,
lpstrFileTitle
,
ofn
->
nMaxFileTitle
);
}
else
{
...
...
dlls/devenum/parsedisplayname.c
View file @
6e3bcb5a
...
...
@@ -94,6 +94,7 @@ static HRESULT WINAPI DEVENUM_IParseDisplayName_ParseDisplayName(
MediaCatMoniker
*
pMoniker
=
NULL
;
CLSID
clsidDevice
;
HRESULT
res
=
S_OK
;
int
classlen
;
TRACE
(
"(%p, %s, %p, %p)
\n
"
,
pbc
,
debugstr_w
(
pszDisplayName
),
pchEaten
,
ppmkOut
);
...
...
@@ -107,12 +108,13 @@ static HRESULT WINAPI DEVENUM_IParseDisplayName_ParseDisplayName(
/* size = pszBetween - pszDisplayName - 1 (for '\\' after CLSID)
* + 1 (for NULL character)
*/
pszClass
=
CoTaskMemAlloc
((
int
)(
pszBetween
-
pszDisplayName
)
*
sizeof
(
WCHAR
));
classlen
=
(
int
)(
pszBetween
-
pszDisplayName
-
1
);
pszClass
=
CoTaskMemAlloc
((
classlen
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
pszClass
)
return
E_OUTOFMEMORY
;
strncpyW
(
pszClass
,
pszDisplayName
,
(
int
)(
pszBetween
-
pszDisplayName
)
-
1
);
pszClass
[
(
int
)(
pszBetween
-
pszDisplayName
)
-
1
]
=
0
;
memcpy
(
pszClass
,
pszDisplayName
,
classlen
*
sizeof
(
WCHAR
)
);
pszClass
[
classlen
]
=
0
;
TRACE
(
"Device CLSID: %s
\n
"
,
debugstr_w
(
pszClass
));
...
...
dlls/dmband/band.c
View file @
6e3bcb5a
...
...
@@ -163,11 +163,11 @@ HRESULT WINAPI IDirectMusicBandImpl_IDirectMusicObject_SetDescriptor (LPDIRECTMU
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CLASS
)
memcpy
(
&
This
->
pDesc
->
guidClass
,
&
pDesc
->
guidClass
,
sizeof
(
pDesc
->
guidClass
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_NAME
)
strncpy
W
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
lstrcpyn
W
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CATEGORY
)
strncpy
W
(
This
->
pDesc
->
wszCategory
,
pDesc
->
wszCategory
,
DMUS_MAX_CATEGORY
);
lstrcpyn
W
(
This
->
pDesc
->
wszCategory
,
pDesc
->
wszCategory
,
DMUS_MAX_CATEGORY
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_FILENAME
)
strncpy
W
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
lstrcpyn
W
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_VERSION
)
memcpy
(
&
This
->
pDesc
->
vVersion
,
&
pDesc
->
vVersion
,
sizeof
(
pDesc
->
vVersion
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_DATE
)
...
...
dlls/dmcompos/chordmap.c
View file @
6e3bcb5a
...
...
@@ -147,11 +147,11 @@ HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_SetDescriptor (LPDIRE
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CLASS
)
memcpy
(
&
This
->
pDesc
->
guidClass
,
&
pDesc
->
guidClass
,
sizeof
(
pDesc
->
guidClass
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_NAME
)
strncpy
W
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
lstrcpyn
W
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CATEGORY
)
strncpy
W
(
This
->
pDesc
->
wszCategory
,
pDesc
->
wszCategory
,
DMUS_MAX_CATEGORY
);
lstrcpyn
W
(
This
->
pDesc
->
wszCategory
,
pDesc
->
wszCategory
,
DMUS_MAX_CATEGORY
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_FILENAME
)
strncpy
W
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
lstrcpyn
W
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_VERSION
)
memcpy
(
&
This
->
pDesc
->
vVersion
,
&
pDesc
->
vVersion
,
sizeof
(
pDesc
->
vVersion
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_DATE
)
...
...
dlls/dmime/audiopath.c
View file @
6e3bcb5a
...
...
@@ -262,11 +262,11 @@ HRESULT WINAPI IDirectMusicAudioPathImpl_IDirectMusicObject_SetDescriptor (LPDIR
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CLASS
)
memcpy
(
&
This
->
pDesc
->
guidClass
,
&
pDesc
->
guidClass
,
sizeof
(
pDesc
->
guidClass
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_NAME
)
strncpy
W
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
lstrcpyn
W
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CATEGORY
)
strncpy
W
(
This
->
pDesc
->
wszCategory
,
pDesc
->
wszCategory
,
DMUS_MAX_CATEGORY
);
lstrcpyn
W
(
This
->
pDesc
->
wszCategory
,
pDesc
->
wszCategory
,
DMUS_MAX_CATEGORY
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_FILENAME
)
strncpy
W
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
lstrcpyn
W
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_VERSION
)
memcpy
(
&
This
->
pDesc
->
vVersion
,
&
pDesc
->
vVersion
,
sizeof
(
pDesc
->
vVersion
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_DATE
)
...
...
dlls/dmime/graph.c
View file @
6e3bcb5a
...
...
@@ -228,11 +228,11 @@ HRESULT WINAPI IDirectMusicGraphImpl_IDirectMusicObject_SetDescriptor (LPDIRECTM
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CLASS
)
memcpy
(
&
This
->
pDesc
->
guidClass
,
&
pDesc
->
guidClass
,
sizeof
(
pDesc
->
guidClass
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_NAME
)
strncpy
W
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
lstrcpyn
W
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CATEGORY
)
strncpy
W
(
This
->
pDesc
->
wszCategory
,
pDesc
->
wszCategory
,
DMUS_MAX_CATEGORY
);
lstrcpyn
W
(
This
->
pDesc
->
wszCategory
,
pDesc
->
wszCategory
,
DMUS_MAX_CATEGORY
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_FILENAME
)
strncpy
W
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
lstrcpyn
W
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_VERSION
)
memcpy
(
&
This
->
pDesc
->
vVersion
,
&
pDesc
->
vVersion
,
sizeof
(
pDesc
->
vVersion
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_DATE
)
...
...
dlls/dmime/segment.c
View file @
6e3bcb5a
...
...
@@ -548,11 +548,11 @@ HRESULT WINAPI IDirectMusicSegment8Impl_IDirectMusicObject_SetDescriptor (LPDIRE
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CLASS
)
memcpy
(
&
This
->
pDesc
->
guidClass
,
&
pDesc
->
guidClass
,
sizeof
(
pDesc
->
guidClass
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_NAME
)
strncpy
W
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
lstrcpyn
W
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CATEGORY
)
strncpy
W
(
This
->
pDesc
->
wszCategory
,
pDesc
->
wszCategory
,
DMUS_MAX_CATEGORY
);
lstrcpyn
W
(
This
->
pDesc
->
wszCategory
,
pDesc
->
wszCategory
,
DMUS_MAX_CATEGORY
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_FILENAME
)
strncpy
W
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
lstrcpyn
W
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_VERSION
)
memcpy
(
&
This
->
pDesc
->
vVersion
,
&
pDesc
->
vVersion
,
sizeof
(
pDesc
->
vVersion
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_DATE
)
...
...
dlls/dmloader/loaderstream.c
View file @
6e3bcb5a
...
...
@@ -67,7 +67,7 @@ HRESULT WINAPI IDirectMusicLoaderFileStream_Attach (LPSTREAM iface, LPCWSTR wzFi
}
/* create IDirectMusicGetLoader */
This
->
pLoader
=
(
LPDIRECTMUSICLOADER8
)
pLoader
;
strncpy
W
(
This
->
wzFileName
,
wzFile
,
MAX_PATH
);
lstrcpyn
W
(
This
->
wzFileName
,
wzFile
,
MAX_PATH
);
TRACE
(
": succeeded
\n
"
);
return
S_OK
;
}
...
...
dlls/dmscript/script.c
View file @
6e3bcb5a
...
...
@@ -226,11 +226,11 @@ HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicObject_SetDescriptor (LPDIRECT
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CLASS
)
memcpy
(
&
This
->
pDesc
->
guidClass
,
&
pDesc
->
guidClass
,
sizeof
(
pDesc
->
guidClass
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_NAME
)
strncpy
W
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
lstrcpyn
W
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CATEGORY
)
strncpyW
(
This
->
pDesc
->
wszCategory
,
pDesc
->
wszCategory
,
DMUS_MAX_CATEGORY
);
lstrcpynW
(
This
->
pDesc
->
wszCategory
,
pDesc
->
wszCategory
,
DMUS_MAX_CATEGORY
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_FILENAME
)
strncpyW
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
lstrcpynW
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_VERSION
)
memcpy
(
&
This
->
pDesc
->
vVersion
,
&
pDesc
->
vVersion
,
sizeof
(
pDesc
->
vVersion
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_DATE
)
...
...
dlls/dmstyle/style.c
View file @
6e3bcb5a
...
...
@@ -230,11 +230,11 @@ HRESULT WINAPI IDirectMusicStyle8Impl_IDirectMusicObject_SetDescriptor (LPDIRECT
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CLASS
)
memcpy
(
&
This
->
pDesc
->
guidClass
,
&
pDesc
->
guidClass
,
sizeof
(
pDesc
->
guidClass
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_NAME
)
strncpy
W
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
lstrcpyn
W
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CATEGORY
)
strncpyW
(
This
->
pDesc
->
wszCategory
,
pDesc
->
wszCategory
,
DMUS_MAX_CATEGORY
);
lstrcpynW
(
This
->
pDesc
->
wszCategory
,
pDesc
->
wszCategory
,
DMUS_MAX_CATEGORY
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_FILENAME
)
strncpyW
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
lstrcpynW
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_VERSION
)
memcpy
(
&
This
->
pDesc
->
vVersion
,
&
pDesc
->
vVersion
,
sizeof
(
pDesc
->
vVersion
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_DATE
)
...
...
dlls/gdi/font.c
View file @
6e3bcb5a
...
...
@@ -2319,7 +2319,7 @@ GetCharacterPlacementW(
/* Treat the case where no special handling was requested in a fastpath way */
/* copy will do if the GCP_REORDER flag is not set */
if
(
lpResults
->
lpOutString
)
strncpyW
(
lpResults
->
lpOutString
,
lpString
,
nSet
);
memcpy
(
lpResults
->
lpOutString
,
lpString
,
nSet
*
sizeof
(
WCHAR
)
);
if
(
lpResults
->
lpOrder
)
{
...
...
dlls/gdi/freetype.c
View file @
6e3bcb5a
...
...
@@ -2044,13 +2044,13 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
if
(
potm
)
{
pntm
->
ntmTm
.
ntmSizeEM
=
potm
->
otmEMSquare
;
strncpy
W
(
pelf
->
elfLogFont
.
lfFaceName
,
lstrcpyn
W
(
pelf
->
elfLogFont
.
lfFaceName
,
(
WCHAR
*
)((
char
*
)
potm
+
(
ptrdiff_t
)
potm
->
otmpFamilyName
),
LF_FACESIZE
);
strncpy
W
(
pelf
->
elfFullName
,
lstrcpyn
W
(
pelf
->
elfFullName
,
(
WCHAR
*
)((
char
*
)
potm
+
(
ptrdiff_t
)
potm
->
otmpFaceName
),
LF_FULLFACESIZE
);
strncpy
W
(
pelf
->
elfStyle
,
lstrcpyn
W
(
pelf
->
elfStyle
,
(
WCHAR
*
)((
char
*
)
potm
+
(
ptrdiff_t
)
potm
->
otmpStyleName
),
LF_FACESIZE
);
...
...
@@ -2058,8 +2058,8 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
}
else
{
pntm
->
ntmTm
.
ntmSizeEM
=
pntm
->
ntmTm
.
tmHeight
-
pntm
->
ntmTm
.
tmInternalLeading
;
strncpy
W
(
pelf
->
elfLogFont
.
lfFaceName
,
face
->
family
->
FamilyName
,
LF_FACESIZE
);
strncpy
W
(
pelf
->
elfFullName
,
face
->
family
->
FamilyName
,
LF_FACESIZE
);
lstrcpyn
W
(
pelf
->
elfLogFont
.
lfFaceName
,
face
->
family
->
FamilyName
,
LF_FACESIZE
);
lstrcpyn
W
(
pelf
->
elfFullName
,
face
->
family
->
FamilyName
,
LF_FACESIZE
);
pelf
->
elfStyle
[
0
]
=
'\0'
;
}
...
...
dlls/itss/chm_lib.c
View file @
6e3bcb5a
...
...
@@ -1538,7 +1538,7 @@ int chm_enumerate_dir(struct chmFile *h,
curPage
=
h
->
index_head
;
/* initialize pathname state */
strncpy
W
(
prefixRectified
,
prefix
,
CHM_MAX_PATHLEN
);
lstrcpyn
W
(
prefixRectified
,
prefix
,
CHM_MAX_PATHLEN
);
prefixLen
=
strlenW
(
prefixRectified
);
if
(
prefixLen
!=
0
)
{
...
...
dlls/msi/cond.y
View file @
6e3bcb5a
...
...
@@ -701,7 +701,7 @@ static LPWSTR COND_GetString( struct cond_str *str )
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
str
->
len
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
ret
)
{
strncpyW
(
ret
,
str
->
data
,
str
->
len
);
memcpy
(
ret
,
str
->
data
,
str
->
len
*
sizeof
(
WCHAR
)
);
ret
[
str
->
len
]=
0
;
}
TRACE
(
"Got identifier %s
\n
"
,
debugstr_w
(
ret
));
...
...
dlls/msvcrt/locale.c
View file @
6e3bcb5a
...
...
@@ -372,7 +372,7 @@ char* MSVCRT_setlocale(int category, const char* locale)
if
(
next
&&
next
!=
locale
)
{
haveLang
=
1
;
strn
cpy
(
lc
.
search_language
,
locale
,
next
-
locale
);
mem
cpy
(
lc
.
search_language
,
locale
,
next
-
locale
);
locale
+=
next
-
locale
+
1
;
}
...
...
@@ -383,23 +383,23 @@ char* MSVCRT_setlocale(int category, const char* locale)
if
(
next
==
locale
)
{
locale
++
;
strncpy
(
lc
.
search_codepage
,
locale
,
MAX_ELEM_LEN
);
lstrcpynA
(
lc
.
search_codepage
,
locale
,
MAX_ELEM_LEN
);
}
else
{
if
(
haveLang
)
{
haveCountry
=
1
;
strn
cpy
(
lc
.
search_country
,
locale
,
next
-
locale
);
mem
cpy
(
lc
.
search_country
,
locale
,
next
-
locale
);
locale
+=
next
-
locale
+
1
;
}
else
{
haveLang
=
1
;
strn
cpy
(
lc
.
search_language
,
locale
,
next
-
locale
);
mem
cpy
(
lc
.
search_language
,
locale
,
next
-
locale
);
locale
+=
next
-
locale
+
1
;
}
strncpy
(
lc
.
search_codepage
,
locale
,
MAX_ELEM_LEN
);
lstrcpynA
(
lc
.
search_codepage
,
locale
,
MAX_ELEM_LEN
);
}
}
else
...
...
@@ -407,12 +407,12 @@ char* MSVCRT_setlocale(int category, const char* locale)
if
(
haveLang
)
{
haveCountry
=
1
;
strncpy
(
lc
.
search_country
,
locale
,
MAX_ELEM_LEN
);
lstrcpynA
(
lc
.
search_country
,
locale
,
MAX_ELEM_LEN
);
}
else
{
haveLang
=
1
;
strncpy
(
lc
.
search_language
,
locale
,
MAX_ELEM_LEN
);
lstrcpynA
(
lc
.
search_language
,
locale
,
MAX_ELEM_LEN
);
}
}
...
...
dlls/msvideo/mciwnd.c
View file @
6e3bcb5a
...
...
@@ -1010,7 +1010,7 @@ end_of_mci_open:
return
mwi
->
lasterror
;
case
MCIWNDM_RETURNSTRINGW
:
strncpy
W
((
LPWSTR
)
lParam
,
mwi
->
return_string
,
wParam
);
lstrcpyn
W
((
LPWSTR
)
lParam
,
mwi
->
return_string
,
wParam
);
TRACE
(
"MCIWNDM_RETURNTRINGW %s
\n
"
,
debugstr_wn
((
LPWSTR
)
lParam
,
wParam
));
return
mwi
->
lasterror
;
...
...
@@ -1095,7 +1095,7 @@ end_of_mci_open:
case
MCIWNDM_GETFILENAMEW
:
TRACE
(
"MCIWNDM_GETFILENAMEW: %s
\n
"
,
debugstr_w
(
mwi
->
lpName
));
if
(
mwi
->
lpName
)
strncpy
W
((
LPWSTR
)
lParam
,
mwi
->
lpName
,
wParam
);
lstrcpyn
W
((
LPWSTR
)
lParam
,
mwi
->
lpName
,
wParam
);
return
0
;
case
MCIWNDM_GETTIMEFORMATA
:
...
...
dlls/msvideo/msvideo16.c
View file @
6e3bcb5a
...
...
@@ -834,7 +834,7 @@ DWORD WINAPI VideoCapDriverDescAndVer16(WORD nr, LPSTR buf1, WORD buf1len,
else
{
TRACE
(
"GetFileVersionInfoA failed for %s.
\n
"
,
fn
);
strncpy
(
buf2
,
fn
,
buf2len
);
/* msvideo.dll appears to copy fn*/
lstrcpynA
(
buf2
,
fn
,
buf2len
);
/* msvideo.dll appears to copy fn*/
}
/* FIXME: language problem? */
if
(
VerQueryValueA
(
infobuf
,
...
...
@@ -843,13 +843,15 @@ DWORD WINAPI VideoCapDriverDescAndVer16(WORD nr, LPSTR buf1, WORD buf1len,
&
subblocklen
))
{
UINT
copylen
=
min
(
subblocklen
,
buf1len
-
1
);
memcpy
(
buf1
,
subblock
,
copylen
);
buf1
[
copylen
]
=
'\0'
;
TRACE
(
"VQA returned %s
\n
"
,
(
LPCSTR
)
subblock
);
strncpy
(
buf1
,
subblock
,
buf1len
);
}
else
{
TRACE
(
"VQA did not return on query
\\
StringFileInfo
\\
040904E4
\\
FileDescription?
\n
"
);
strncpy
(
buf1
,
fn
,
buf1len
);
/* msvideo.dll appears to copy fn*/
lstrcpynA
(
buf1
,
fn
,
buf1len
);
/* msvideo.dll appears to copy fn*/
}
HeapFree
(
GetProcessHeap
(),
0
,
infobuf
);
return
0
;
...
...
dlls/oledlg/insobjdlg.c
View file @
6e3bcb5a
...
...
@@ -479,7 +479,7 @@ static BOOL UIINSERTOBJECTDLG_OnOpen(InsertObjectDlgInfo* pdlgInfo)
WCHAR
wcsFile
[
MAX_PATH
];
SendMessageA
(
pdlgInfo
->
hwndFileTB
,
WM_GETTEXT
,
(
WPARAM
)
MAX_PATH
,
(
LPARAM
)
fname
);
strncpy
(
pdlgInfo
->
lpOleUIInsertObject
->
lpszFile
,
fname
,
pdlgInfo
->
lpOleUIInsertObject
->
cchFile
);
lstrcpynA
(
pdlgInfo
->
lpOleUIInsertObject
->
lpszFile
,
fname
,
pdlgInfo
->
lpOleUIInsertObject
->
cchFile
);
RtlMultiByteToUnicodeN
(
wcsFile
,
MAX_PATH
,
NULL
,
fname
,
MAX_PATH
);
if
(
ERROR_SUCCESS
==
(
hres
=
GetClassFile
(
wcsFile
,
&
pdlgInfo
->
lpOleUIInsertObject
->
clsid
)))
...
...
dlls/quartz/filtermapper.c
View file @
6e3bcb5a
...
...
@@ -732,7 +732,7 @@ static HRESULT WINAPI FilterMapper2_RegisterFilter(
if
(
SUCCEEDED
(
hr
))
{
strncpyW
(
pCurrent
,
szClsidTemp
,
CHARS_IN_GUID
);
memcpy
(
pCurrent
,
szClsidTemp
,
CHARS_IN_GUID
*
sizeof
(
WCHAR
)
);
pCurrent
+=
CHARS_IN_GUID
-
1
;
pCurrent
[
0
]
=
'\\'
;
...
...
dlls/shell32/debughlp.c
View file @
6e3bcb5a
...
...
@@ -159,13 +159,13 @@ DWORD _dbg_ILSimpleGetText (LPCITEMIDLIST pidl, LPSTR szOut, UINT uOutSize)
if
(
_dbg_ILIsDesktop
(
pidl
))
{
/* desktop */
if
(
szOut
)
strncpy
(
szOut
,
"Desktop"
,
uOutSize
);
if
(
szOut
)
lstrcpynA
(
szOut
,
"Desktop"
,
uOutSize
);
dwReturn
=
strlen
(
"Desktop"
);
}
else
if
((
szSrc
=
_dbg_ILGetTextPointer
(
pidl
)
))
{
/* filesystem */
if
(
szOut
)
strncpy
(
szOut
,
szSrc
,
uOutSize
);
if
(
szOut
)
lstrcpynA
(
szOut
,
szSrc
,
uOutSize
);
dwReturn
=
strlen
(
szSrc
);
}
else
if
((
riid
=
_dbg_ILGetGUIDPointer
(
pidl
)
))
...
...
dlls/shell32/shelllink.c
View file @
6e3bcb5a
...
...
@@ -909,7 +909,7 @@ static HRESULT Stream_WriteAdvertiseInfo( IStream* stm, LPCWSTR string, DWORD ma
memset
(
&
buffer
,
0
,
sizeof
buffer
);
buffer
.
dbh
.
cbSize
=
sizeof
buffer
;
buffer
.
dbh
.
dwSignature
=
magic
;
strncpy
W
(
buffer
.
szwDarwinID
,
string
,
MAX_PATH
);
lstrcpyn
W
(
buffer
.
szwDarwinID
,
string
,
MAX_PATH
);
WideCharToMultiByte
(
CP_ACP
,
0
,
string
,
-
1
,
buffer
.
szDarwinID
,
MAX_PATH
,
NULL
,
NULL
);
return
IStream_Write
(
stm
,
&
buffer
,
buffer
.
dbh
.
cbSize
,
&
count
);
...
...
dlls/shell32/shellpath.c
View file @
6e3bcb5a
...
...
@@ -1210,7 +1210,7 @@ static HRESULT _SHGetUserShellFolderPath(HKEY rootKey, LPCWSTR userPrefix,
WCHAR
szTemp
[
MAX_PATH
];
_SHExpandEnvironmentStrings
(
path
,
szTemp
);
strncpy
W
(
path
,
szTemp
,
MAX_PATH
);
lstrcpyn
W
(
path
,
szTemp
,
MAX_PATH
);
}
ret
=
RegSetValueExW
(
shellFolderKey
,
value
,
0
,
REG_SZ
,
(
LPBYTE
)
path
,
(
strlenW
(
path
)
+
1
)
*
sizeof
(
WCHAR
));
...
...
@@ -1493,12 +1493,12 @@ static HRESULT _SHGetProfilesValue(HKEY profilesKey, LPCWSTR szValueName,
else
{
/* Missing or invalid value, set a default */
strncpyW
(
szValue
,
szDefault
,
MAX_PATH
);
szValue
[
MAX_PATH
-
1
]
=
'\0'
;
lstrcpynW
(
szValue
,
szDefault
,
MAX_PATH
);
TRACE
(
"Setting missing value %s to %s
\n
"
,
debugstr_w
(
szValueName
),
debugstr_w
(
szValue
));
debugstr_w
(
szValue
));
lRet
=
RegSetValueExW
(
profilesKey
,
szValueName
,
0
,
REG_EXPAND_SZ
,
(
LPBYTE
)
szValue
,
(
strlenW
(
szValue
)
+
1
)
*
sizeof
(
WCHAR
));
(
LPBYTE
)
szValue
,
(
strlenW
(
szValue
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
lRet
)
hr
=
HRESULT_FROM_WIN32
(
lRet
);
else
...
...
dlls/shell32/shlexec.c
View file @
6e3bcb5a
...
...
@@ -1218,7 +1218,7 @@ BOOL WINAPI ShellExecuteExW32 (LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfun
LPWSTR
beg
=
wszApplicationName
/*sei_tmp.lpFile*/
;
for
(
s
=
beg
;
(
space
=
strchrW
(
s
,
' '
));
s
=
space
+
1
)
{
int
idx
=
space
-
sei_tmp
.
lpFile
;
strncpyW
(
buffer
,
sei_tmp
.
lpFile
,
idx
);
memcpy
(
buffer
,
sei_tmp
.
lpFile
,
idx
*
sizeof
(
WCHAR
)
);
buffer
[
idx
]
=
'\0'
;
/*FIXME This finds directory paths if the targeted file name contains spaces. */
...
...
@@ -1296,7 +1296,7 @@ BOOL WINAPI ShellExecuteExW32 (LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfun
TRACE
(
"Got URL: %s
\n
"
,
debugstr_w
(
lpFile
));
/* Looking for ...protocol\shell\lpOperation\command */
strncpyW
(
lpstrProtocol
,
lpFile
,
iSize
);
memcpy
(
lpstrProtocol
,
lpFile
,
iSize
*
sizeof
(
WCHAR
)
);
lpstrProtocol
[
iSize
]
=
'\0'
;
strcatW
(
lpstrProtocol
,
wShell
);
strcatW
(
lpstrProtocol
,
sei_tmp
.
lpVerb
?
sei_tmp
.
lpVerb
:
wszOpen
);
...
...
dlls/shell32/systray.c
View file @
6e3bcb5a
...
...
@@ -256,8 +256,7 @@ void SYSTRAY_ItemSetTip(SystrayItem *ptrayItem, CHAR* szTip, int modify)
{
TTTOOLINFOA
ti
;
strncpy
(
ptrayItem
->
notifyIcon
.
szTip
,
szTip
,
sizeof
(
ptrayItem
->
notifyIcon
.
szTip
));
ptrayItem
->
notifyIcon
.
szTip
[
sizeof
(
ptrayItem
->
notifyIcon
.
szTip
)
-
1
]
=
0
;
lstrcpynA
(
ptrayItem
->
notifyIcon
.
szTip
,
szTip
,
sizeof
(
ptrayItem
->
notifyIcon
.
szTip
));
ti
.
cbSize
=
sizeof
(
TTTOOLINFOA
);
ti
.
uFlags
=
0
;
...
...
dlls/user/edit.c
View file @
6e3bcb5a
...
...
@@ -3052,7 +3052,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, LPCWSTR lpsz_replac
bufl
=
e
-
s
;
buf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
bufl
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
buf
)
return
;
strncpyW
(
buf
,
es
->
text
+
s
,
bufl
);
memcpy
(
buf
,
es
->
text
+
s
,
bufl
*
sizeof
(
WCHAR
)
);
buf
[
bufl
]
=
0
;
/* ensure 0 termination */
/* now delete */
strcpyW
(
es
->
text
+
s
,
es
->
text
+
e
);
...
...
@@ -3113,7 +3113,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, LPCWSTR lpsz_replac
if
(
!
es
->
undo_insert_count
&&
(
*
es
->
undo_text
&&
(
s
==
es
->
undo_position
)))
{
/* undo-buffer is extended to the right */
EDIT_MakeUndoFit
(
es
,
utl
+
e
-
s
);
strncpyW
(
es
->
undo_text
+
utl
,
buf
,
e
-
s
+
1
);
memcpy
(
es
->
undo_text
+
utl
,
buf
,
(
e
-
s
)
*
sizeof
(
WCHAR
)
);
(
es
->
undo_text
+
utl
)[
e
-
s
]
=
0
;
/* ensure 0 termination */
}
else
if
(
!
es
->
undo_insert_count
&&
(
*
es
->
undo_text
&&
(
e
==
es
->
undo_position
)))
{
/* undo-buffer is extended to the left */
...
...
@@ -3126,7 +3126,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, LPCWSTR lpsz_replac
}
else
{
/* new undo-buffer */
EDIT_MakeUndoFit
(
es
,
e
-
s
);
strncpyW
(
es
->
undo_text
,
buf
,
e
-
s
+
1
);
memcpy
(
es
->
undo_text
,
buf
,
(
e
-
s
)
*
sizeof
(
WCHAR
)
);
es
->
undo_text
[
e
-
s
]
=
0
;
/* ensure 0 termination */
es
->
undo_position
=
s
;
}
...
...
@@ -3932,13 +3932,15 @@ static void EDIT_WM_Copy(EDITSTATE *es)
INT
e
=
max
(
es
->
selection_start
,
es
->
selection_end
);
HGLOBAL
hdst
;
LPWSTR
dst
;
DWORD
len
;
if
(
e
==
s
)
return
;
hdst
=
GlobalAlloc
(
GMEM_MOVEABLE
|
GMEM_DDESHARE
,
(
DWORD
)(
e
-
s
+
1
)
*
sizeof
(
WCHAR
));
len
=
e
-
s
;
hdst
=
GlobalAlloc
(
GMEM_MOVEABLE
|
GMEM_DDESHARE
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
dst
=
GlobalLock
(
hdst
);
strncpyW
(
dst
,
es
->
text
+
s
,
e
-
s
);
dst
[
e
-
s
]
=
0
;
/* ensure 0 termination */
memcpy
(
dst
,
es
->
text
+
s
,
len
*
sizeof
(
WCHAR
)
);
dst
[
len
]
=
0
;
/* ensure 0 termination */
TRACE
(
"%s
\n
"
,
debugstr_w
(
dst
));
GlobalUnlock
(
hdst
);
OpenClipboard
(
es
->
hwndSelf
);
...
...
dlls/winedos/int21.c
View file @
6e3bcb5a
...
...
@@ -3434,7 +3434,7 @@ static int INT21_GetDiskSerialNumber( CONTEXT86 *context )
*
(
WORD
*
)
dataptr
=
0
;
memcpy
(
dataptr
+
2
,
&
serial
,
sizeof
(
DWORD
));
WideCharToMultiByte
(
CP_OEMCP
,
0
,
label
,
11
,
dataptr
+
6
,
11
,
NULL
,
NULL
);
strn
cpy
(
dataptr
+
17
,
"FAT16 "
,
8
);
mem
cpy
(
dataptr
+
17
,
"FAT16 "
,
8
);
return
1
;
}
...
...
dlls/wininet/dialogs.c
View file @
6e3bcb5a
...
...
@@ -76,7 +76,7 @@ static BOOL WININET_GetProxyServer( HINTERNET hRequest, LPWSTR szBuf, DWORD sz )
if
(
NULL
==
hIC
)
return
FALSE
;
strncpy
W
(
szBuf
,
hIC
->
lpszProxy
,
sz
);
lstrcpyn
W
(
szBuf
,
hIC
->
lpszProxy
,
sz
);
/* FIXME: perhaps it would be better to use InternetCrackUrl here */
p
=
strchrW
(
szBuf
,
':'
);
...
...
dlls/wininet/internet.c
View file @
6e3bcb5a
...
...
@@ -1195,6 +1195,13 @@ static INTERNET_SCHEME GetInternetSchemeW(LPCWSTR lpszScheme, DWORD nMaxCmp)
*
* Helper function for InternetCrackUrlW
*
* PARAMS
* lppszComponent [O] Holds the returned string
* dwComponentLen [I] Holds the size of lppszComponent
* [O] Holds the length of the string in lppszComponent without '\0'
* lpszStart [I] Holds the string to copy from
* len [I] Holds the length of lpszStart without '\0'
*
* RETURNS
* TRUE on success
* FALSE on failure
...
...
@@ -1217,7 +1224,7 @@ static BOOL SetUrlComponentValueW(LPWSTR* lppszComponent, LPDWORD dwComponentLen
else
{
DWORD
ncpylen
=
min
((
*
dwComponentLen
)
-
1
,
len
);
strncpyW
(
*
lppszComponent
,
lpszStart
,
ncpylen
);
memcpy
(
*
lppszComponent
,
lpszStart
,
ncpylen
*
sizeof
(
WCHAR
)
);
(
*
lppszComponent
)[
ncpylen
]
=
'\0'
;
*
dwComponentLen
=
ncpylen
;
}
...
...
dlls/wininet/utility.c
View file @
6e3bcb5a
...
...
@@ -53,6 +53,7 @@ time_t ConvertTimeString(LPCWSTR asctime)
if
(
!
asctime
||
!
timelen
)
return
0
;
/* The atoiWs below relie on that tmpChar is \0 padded? */
strncpyW
(
tmpChar
,
asctime
,
TIME_STRING_LEN
);
/* Assert that the string is the expected length */
...
...
dlls/winmm/wineoss/audio.c
View file @
6e3bcb5a
...
...
@@ -701,7 +701,7 @@ static BOOL OSS_WaveOutInit(OSS_DEVICE* ossdev)
if
((
mixer
=
open
(
ossdev
->
mixer_name
,
O_RDONLY
|
O_NDELAY
))
>=
0
)
{
mixer_info
info
;
if
(
ioctl
(
mixer
,
SOUND_MIXER_INFO
,
&
info
)
>=
0
)
{
strncpy
(
ossdev
->
ds_desc
.
szDesc
,
info
.
name
,
sizeof
(
info
.
name
));
lstrcpynA
(
ossdev
->
ds_desc
.
szDesc
,
info
.
name
,
sizeof
(
info
.
name
));
strcpy
(
ossdev
->
ds_desc
.
szDrvname
,
"wineoss.drv"
);
MultiByteToWideChar
(
CP_ACP
,
0
,
info
.
name
,
sizeof
(
info
.
name
),
ossdev
->
out_caps
.
szPname
,
...
...
programs/winecfg/drivedetect.c
View file @
6e3bcb5a
...
...
@@ -310,7 +310,7 @@ int autodetect_drives()
return
FALSE
;
}
str
ncpy
(
label
,
"Drive X"
,
8
);
str
cpy
(
label
,
"Drive X"
);
label
[
6
]
=
letter
;
WINE_TRACE
(
"adding drive %c for %s, type %s with label %s
\n
"
,
letter
,
ent
->
mnt_dir
,
ent
->
mnt_type
,
label
);
...
...
tools/sfnt2fnt.c
View file @
6e3bcb5a
...
...
@@ -207,12 +207,13 @@ static void fill_fontinfo(FT_Face face, int enc, FILE *fp, int dpi, unsigned cha
num_names
=
FT_Get_Sfnt_Name_Count
(
face
);
for
(
i
=
0
;
i
<
num_names
;
i
++
)
{
FT_Get_Sfnt_Name
(
face
,
i
,
&
sfntname
);
strn
cpy
(
namebuf
,
sfntname
.
string
,
sfntname
.
string_len
);
mem
cpy
(
namebuf
,
sfntname
.
string
,
sfntname
.
string_len
);
namebuf
[
sfntname
.
string_len
]
=
'\0'
;
if
(
sfntname
.
platform_id
==
1
&&
sfntname
.
encoding_id
==
0
&&
sfntname
.
language_id
==
0
&&
sfntname
.
name_id
==
0
)
{
if
(
sfntname
.
platform_id
==
1
&&
sfntname
.
encoding_id
==
0
&&
sfntname
.
language_id
==
0
&&
sfntname
.
name_id
==
0
)
{
strncpy
(
hdr
.
dfCopyright
,
namebuf
,
60
);
hdr
.
dfCopyright
[
59
]
=
'\0'
;
}
}
}
os2
=
FT_Get_Sfnt_Table
(
face
,
ft_sfnt_os2
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment