From a62978be8c32bc19094f3db8d8059fd01e87358c Mon Sep 17 00:00:00 2001 From: midipix Date: Jan 19 2017 20:57:34 +0000 Subject: __ntapi_tt_get_peb_env_block_utf16(): rewrite more elegantly. --- 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; }