From 0b8fbacd5835357f1b8885ac2692e633a57269d9 Mon Sep 17 00:00:00 2001 From: Gina Peter Bnayard Date: Tue, 13 Aug 2024 16:59:43 +0200 Subject: [PATCH] ext/standard/info.c: Remove unreachable conditional branch --- ext/standard/info.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ext/standard/info.c b/ext/standard/info.c index 864199d66de..5e273588cb1 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -680,13 +680,12 @@ PHPAPI zend_string *php_get_uname(char mode) } else if (mode == 'v') { char *winver = php_get_windows_name(); dwBuild = (DWORD)(HIWORD(dwVersion)); - if (winver == NULL) { - return strpprintf(0, "build %d", dwBuild); - } else { - zend_string *build_with_version = strpprintf(0, "build %d (%s)", dwBuild, winver); - efree(winver); - return build_with_version; - } + + ZEND_ASSERT(winver != NULL); + + zend_string *build_with_version = strpprintf(0, "build %d (%s)", dwBuild, winver); + efree(winver); + return build_with_version; } else if (mode == 'm') { php_get_windows_cpu(tmp_uname, sizeof(tmp_uname)); php_uname = tmp_uname;