various: use mp_tprintf_buf wrapper to work around mingw garbage

Look it up if you really care but basically z as a format specifier
often doesn't work in mingw because reasons. Our CI was working by
accident because of meson previously ignoring the CFLAGS variable. Use
our wrapper instead for these places.
This commit is contained in:
Kacper Michajłow 2024-10-17 21:29:45 -05:00 committed by Dudemanguy
parent 3d3d06f981
commit 5fed98e0ee
2 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ int mp_mkostemps(char *template, int suffixlen, int flags)
// not truly random; just a counter would be sufficient). // not truly random; just a counter would be sufficient).
size_t fuckmess = mp_rand_next(); size_t fuckmess = mp_rand_next();
char crap[7] = ""; char crap[7] = "";
snprintf(crap, sizeof(crap), "%06zx", fuckmess); mp_tprintf_buf(crap, sizeof(crap), "%06zx", fuckmess);
memcpy(t, crap, 6); memcpy(t, crap, 6);
int res = open(template, O_RDWR | O_CREAT | O_EXCL | flags, 0600); int res = open(template, O_RDWR | O_CREAT | O_EXCL | flags, 0600);

View File

@ -143,9 +143,9 @@ static char *fmtmsg_buf(char *buf, size_t buf_size, DWORD errorID)
FORMAT_MESSAGE_IGNORE_INSERTS, FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, errorID, 0, buf, buf_size, NULL); NULL, errorID, 0, buf, buf_size, NULL);
if (!n && GetLastError() == ERROR_MORE_DATA) { if (!n && GetLastError() == ERROR_MORE_DATA) {
snprintf(buf, buf_size, mp_tprintf_buf(buf, buf_size,
"<Insufficient buffer size (%zd) for error message>", "<Insufficient buffer size (%zd) for error message>",
buf_size); buf_size);
} else { } else {
if (n > 0 && buf[n-1] == '\n') if (n > 0 && buf[n-1] == '\n')
buf[n-1] = '\0'; buf[n-1] = '\0';