From a08a2b48b489572db89940027206020ee714afa5 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 12 Nov 2020 14:58:47 +0100 Subject: Strip trailing line breaks and periods from Windows error messages PHP error messages should not contain line breaks, so we remove these from the Windows specific error messages. We also remove trailing periods for the same reason. Closes GH-6423. --- main/main.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'main/main.c') diff --git a/main/main.c b/main/main.c index 4511453dce..60fdb89efe 100644 --- a/main/main.c +++ b/main/main.c @@ -1110,13 +1110,6 @@ PHPAPI ZEND_COLD void php_error_docref2(const char *docref, const char *param1, #ifdef PHP_WIN32 PHPAPI ZEND_COLD void php_win32_docref2_from_error(DWORD error, const char *param1, const char *param2) { char *buf = php_win32_error_to_msg(error); - size_t buf_len; - - buf_len = strlen(buf); - if (buf_len >= 2) { - buf[buf_len - 1] = '\0'; - buf[buf_len - 2] = '\0'; - } php_error_docref2(NULL, param1, param2, E_WARNING, "%s (code: %lu)", buf, error); php_win32_error_msg_free(buf); } -- cgit v1.2.1