Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
aafef01c
Commit
aafef01c
authored
Feb 23, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix _wdupenv_s behavior with missing env var.
parent
5a08eab3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
msvcr80.c
dlls/msvcr80/tests/msvcr80.c
+0
-3
environ.c
dlls/msvcrt/environ.c
+6
-1
No files found.
dlls/msvcr80/tests/msvcr80.c
View file @
aafef01c
...
@@ -211,11 +211,8 @@ static void test_wdupenv_s(void)
...
@@ -211,11 +211,8 @@ static void test_wdupenv_s(void)
len
=
0xdeadbeef
;
len
=
0xdeadbeef
;
tmp
=
(
void
*
)
0xdeadbeef
;
tmp
=
(
void
*
)
0xdeadbeef
;
ret
=
p_wdupenv_s
(
&
tmp
,
&
len
,
L"nonexistent"
);
ret
=
p_wdupenv_s
(
&
tmp
,
&
len
,
L"nonexistent"
);
todo_wine
ok
(
!
ret
,
"_wdupenv_s returned %d
\n
"
,
ret
);
ok
(
!
ret
,
"_wdupenv_s returned %d
\n
"
,
ret
);
todo_wine
ok
(
!
len
,
"_wdupenv_s returned length is %Id
\n
"
,
len
);
ok
(
!
len
,
"_wdupenv_s returned length is %Id
\n
"
,
len
);
todo_wine
ok
(
!
tmp
,
"_wdupenv_s returned pointer is %p
\n
"
,
tmp
);
ok
(
!
tmp
,
"_wdupenv_s returned pointer is %p
\n
"
,
tmp
);
}
}
...
...
dlls/msvcrt/environ.c
View file @
aafef01c
...
@@ -279,7 +279,12 @@ int CDECL _wdupenv_s(wchar_t **buffer, size_t *numberOfElements,
...
@@ -279,7 +279,12 @@ int CDECL _wdupenv_s(wchar_t **buffer, size_t *numberOfElements,
if
(
!
MSVCRT_CHECK_PMT
(
buffer
!=
NULL
))
return
EINVAL
;
if
(
!
MSVCRT_CHECK_PMT
(
buffer
!=
NULL
))
return
EINVAL
;
if
(
!
MSVCRT_CHECK_PMT
(
varname
!=
NULL
))
return
EINVAL
;
if
(
!
MSVCRT_CHECK_PMT
(
varname
!=
NULL
))
return
EINVAL
;
if
(
!
(
e
=
_wgetenv
(
varname
)))
return
*
_errno
()
=
EINVAL
;
if
(
!
(
e
=
_wgetenv
(
varname
)))
{
*
buffer
=
NULL
;
if
(
numberOfElements
)
*
numberOfElements
=
0
;
return
0
;
}
sz
=
wcslen
(
e
)
+
1
;
sz
=
wcslen
(
e
)
+
1
;
if
(
!
(
*
buffer
=
malloc
(
sz
*
sizeof
(
wchar_t
))))
if
(
!
(
*
buffer
=
malloc
(
sz
*
sizeof
(
wchar_t
))))
...
...
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