Skip to content

Commit

Permalink
fixes bug
Browse files Browse the repository at this point in the history
  • Loading branch information
actboy168 committed Apr 11, 2024
1 parent 2a1a515 commit 56e5b44
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions 3rd/lua/utf8_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ char* __cdecl utf8_tmpnam(char* buffer) {
size_t wlen = wcslen(tmp);
size_t len = wtf8_from_utf16_length(tmp, wlen);
wtf8_from_utf16(tmp, wlen, buffer, len);
buffer[len] = '\0';
return buffer;
}

Expand Down Expand Up @@ -181,6 +182,7 @@ unsigned long __stdcall utf8_GetModuleFileNameA(void* module, char* filename, un
}
wtf8_from_utf16(tmp, tmplen, filename, len);
free(tmp);
filename[len] = '\0';
return (unsigned long)len;
}

Expand Down Expand Up @@ -211,6 +213,7 @@ unsigned long __stdcall utf8_FormatMessageA(
}
wtf8_from_utf16(tmp, tmplen, lpBuffer, len);
free(tmp);
lpBuffer[len] = '\0';
return (unsigned long)len;
}

Expand Down

0 comments on commit 56e5b44

Please sign in to comment.