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
b2acafad
Commit
b2acafad
authored
Jul 27, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fixed buffer allocation in _getcwd/_wgetcwd.
parent
8f0fb1e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
dir.c
dlls/msvcrt/dir.c
+5
-7
No files found.
dlls/msvcrt/dir.c
View file @
b2acafad
...
...
@@ -419,11 +419,10 @@ char* CDECL _getcwd(char * buf, int size)
if
(
!
buf
)
{
if
(
size
<
0
)
return
_strdup
(
dir
);
return
msvcrt_strndup
(
dir
,
size
);
if
(
size
<=
dir_len
)
size
=
dir_len
+
1
;
if
(
!
(
buf
=
MSVCRT_malloc
(
size
)))
return
NULL
;
}
if
(
dir_len
>=
size
)
else
if
(
dir_len
>=
size
)
{
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
return
NULL
;
/* buf too small */
...
...
@@ -447,9 +446,8 @@ MSVCRT_wchar_t* CDECL _wgetcwd(MSVCRT_wchar_t * buf, int size)
if
(
!
buf
)
{
if
(
size
<
0
)
return
_wcsdup
(
dir
);
return
msvcrt_wstrndup
(
dir
,
size
);
if
(
size
<=
dir_len
)
size
=
dir_len
+
1
;
if
(
!
(
buf
=
MSVCRT_malloc
(
size
*
sizeof
(
WCHAR
)
)))
return
NULL
;
}
if
(
dir_len
>=
size
)
{
...
...
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