mirror of https://github.com/mpv-player/mpv
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:
parent
3d3d06f981
commit
5fed98e0ee
|
@ -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);
|
||||||
|
|
|
@ -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';
|
||||||
|
|
Loading…
Reference in New Issue