From 3e1167260deac6c4a211fbe41338d5739c84de0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 17 Dec 2025 09:38:06 +0800 Subject: [PATCH] IO (Windows): removes unneeded null terminator appending --- src/common/io/io_windows.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/io/io_windows.c b/src/common/io/io_windows.c index 8724d0ee9..33f9c1941 100644 --- a/src/common/io/io_windows.c +++ b/src/common/io/io_windows.c @@ -133,7 +133,7 @@ HANDLE openat(HANDLE dfd, const char* fileName, bool directory) wchar_t fileNameW[MAX_PATH]; int len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, fileName, -1, fileNameW, ARRAY_SIZE(fileNameW)); if (len == 0) return INVALID_HANDLE_VALUE; - fileNameW[len] = L'\0'; + // Implies `fileNameW[len] = L'\0';` and `len` includes the null terminator for (int i = 0; i < len - 1; ++i) {