From a62978be8c32bc19094f3db8d8059fd01e87358c Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 19 Jan 2017 19:54:52 +0000 Subject: __ntapi_tt_get_peb_env_block_utf16(): rewrite more elegantly. --- src/argv/ntapi_tt_argv_envp.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/argv') 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; } -- cgit v1.2.3