diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-11-12 14:58:47 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-11-12 16:42:28 +0100 |
commit | a08a2b48b489572db89940027206020ee714afa5 (patch) | |
tree | 7f612cfa39f9ac4d78b22e2ad25f32879b729776 /main/main.c | |
parent | 34dd032e4e70a33e3e8fa27e38af62f63601b447 (diff) | |
download | php-git-a08a2b48b489572db89940027206020ee714afa5.tar.gz |
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.
Diffstat (limited to 'main/main.c')
-rw-r--r-- | main/main.c | 7 |
1 files changed, 0 insertions, 7 deletions
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); } |