[APITESTS] Use StringCbPrintfA instead of sprintf

And fix a buffer size in Test_AddFontResourceA
This commit is contained in:
Victor Perevertkin 2019-08-17 23:04:41 +03:00
parent f7dc14cca5
commit 6b10706205
8 changed files with 36 additions and 32 deletions

View file

@ -18,9 +18,9 @@ PVOID LoadCodePageData(ULONG Code)
GetSystemDirectoryA(sysdir, MAX_PATH);
if (Code != -1)
sprintf(filename, "%s\\c_%lu.nls", sysdir, Code);
StringCbPrintfA(filename, sizeof(filename), "%s\\c_%lu.nls", sysdir, Code);
else
sprintf(filename, "%s\\l_intl.nls", sysdir);
StringCbPrintfA(filename, sizeof(filename), "%s\\l_intl.nls", sysdir);
hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if (hFile != INVALID_HANDLE_VALUE)