Skip to content

Commit 3e11672

Browse files
committed
IO (Windows): removes unneeded null terminator appending
1 parent 0130f61 commit 3e11672

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/common/io/io_windows.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ HANDLE openat(HANDLE dfd, const char* fileName, bool directory)
133133
wchar_t fileNameW[MAX_PATH];
134134
int len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, fileName, -1, fileNameW, ARRAY_SIZE(fileNameW));
135135
if (len == 0) return INVALID_HANDLE_VALUE;
136-
fileNameW[len] = L'\0';
136+
// Implies `fileNameW[len] = L'\0';` and `len` includes the null terminator
137137

138138
for (int i = 0; i < len - 1; ++i)
139139
{

0 commit comments

Comments
 (0)