summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-01-19 19:54:52 +0000
committermidipix <writeonce@midipix.org>2017-01-19 15:57:34 -0500
commita62978be8c32bc19094f3db8d8059fd01e87358c (patch)
tree6155d84b8c1a3a3e1b3d47a717680757fcc5dd58 /src
parent9cb431a807c05028a8c4ccda6371cc3a94d35883 (diff)
downloadntapi-a62978be8c32bc19094f3db8d8059fd01e87358c.tar.bz2
ntapi-a62978be8c32bc19094f3db8d8059fd01e87358c.tar.xz
__ntapi_tt_get_peb_env_block_utf16(): rewrite more elegantly.
Diffstat (limited to 'src')
-rw-r--r--src/argv/ntapi_tt_argv_envp.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/argv/ntapi_tt_argv_envp.c b/src/argv/ntapi_tt_argv_envp.c
index 1c20cfc..b0a5afe 100644
--- a/src/argv/ntapi_tt_argv_envp.c
+++ b/src/argv/ntapi_tt_argv_envp.c
@@ -706,12 +706,9 @@ wchar16_t * __stdcall __ntapi_tt_get_cmd_line_utf16(void)
wchar16_t * __stdcall __ntapi_tt_get_peb_env_block_utf16(void)
{
- nt_peb * peb;
-
- peb = (nt_peb *)pe_get_peb_address();
+ nt_peb * peb;
- if (peb)
- return peb->process_params->environment;
- else
- return (wchar16_t *)0;
+ return (peb = (nt_peb *)pe_get_peb_address())
+ ? peb->process_params->environment
+ : 0;
}