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
628f2a1e
Commit
628f2a1e
authored
Jan 29, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Use wcsnlen().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a524ab50
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
11 deletions
+2
-11
path.c
dlls/kernelbase/path.c
+2
-11
No files found.
dlls/kernelbase/path.c
View file @
628f2a1e
...
...
@@ -105,15 +105,6 @@ static WCHAR *heap_strdupAtoW(const char *str)
return
ret
;
}
static
SIZE_T
strnlenW
(
const
WCHAR
*
string
,
SIZE_T
maxlen
)
{
SIZE_T
i
;
for
(
i
=
0
;
i
<
maxlen
;
i
++
)
if
(
!
string
[
i
])
break
;
return
i
;
}
static
BOOL
is_drive_spec
(
const
WCHAR
*
str
)
{
return
((
str
[
0
]
>=
'A'
&&
str
[
0
]
<=
'Z'
)
||
(
str
[
0
]
>=
'a'
&&
str
[
0
]
<=
'z'
))
&&
str
[
1
]
==
':'
;
...
...
@@ -517,7 +508,7 @@ HRESULT WINAPI PathCchAddExtension(WCHAR *path, SIZE_T size, const WCHAR *extens
if
(
FAILED
(
hr
))
return
hr
;
if
(
*
existing_extension
)
return
S_FALSE
;
path_length
=
strnlenW
(
path
,
size
);
path_length
=
wcsnlen
(
path
,
size
);
dot_length
=
has_dot
?
0
:
1
;
extension_length
=
lstrlenW
(
extension
);
...
...
@@ -752,7 +743,7 @@ HRESULT WINAPI PathCchRemoveBackslashEx(WCHAR *path, SIZE_T path_size, WCHAR **p
return
E_INVALIDARG
;
}
path_length
=
strnlenW
(
path
,
path_size
);
path_length
=
wcsnlen
(
path
,
path_size
);
if
(
path_length
==
path_size
&&
!
path
[
path_length
])
return
E_INVALIDARG
;
root_end
=
get_root_end
(
path
);
...
...
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