diff --git a/misc/io_utils.c b/misc/io_utils.c index fafed772cc..777e1c780c 100644 --- a/misc/io_utils.c +++ b/misc/io_utils.c @@ -45,7 +45,7 @@ int mp_mkostemps(char *template, int suffixlen, int flags) // not truly random; just a counter would be sufficient). size_t fuckmess = mp_rand_next(); char crap[7] = ""; - snprintf(crap, sizeof(crap), "%06zx", fuckmess); + mp_tprintf_buf(crap, sizeof(crap), "%06zx", fuckmess); memcpy(t, crap, 6); int res = open(template, O_RDWR | O_CREAT | O_EXCL | flags, 0600); diff --git a/osdep/windows_utils.c b/osdep/windows_utils.c index 91eef62cb8..2befea2d86 100644 --- a/osdep/windows_utils.c +++ b/osdep/windows_utils.c @@ -143,9 +143,9 @@ static char *fmtmsg_buf(char *buf, size_t buf_size, DWORD errorID) FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errorID, 0, buf, buf_size, NULL); if (!n && GetLastError() == ERROR_MORE_DATA) { - snprintf(buf, buf_size, - "", - buf_size); + mp_tprintf_buf(buf, buf_size, + "", + buf_size); } else { if (n > 0 && buf[n-1] == '\n') buf[n-1] = '\0';