fix: warning: format specifies type 'unsigned long' but the argument has type 'time_t'

mz_os_posix.c:409:61: warning: format specifies type 'unsigned long' but the argument
has type 'time_t' (aka 'long long') [-Wformat]
  409 |     result = snprintf(path, max_path, "%s/%lux", temp_path, time(NULL));
      |                                           ~~~               ^~~~~~~~~~
      |                                           %lld
1 warning generated.
This commit is contained in:
Brad Smith 2026-07-12 20:44:43 -04:00 committed by Nathan Moin Vaziri
parent 04c976d369
commit d805b1b079

View file

@ -453,7 +453,7 @@ int32_t mz_os_get_temp_path(char *path, int32_t max_path, const char *prefix) {
} }
/* Create a filename inside the temporary directory using current time */ /* Create a filename inside the temporary directory using current time */
result = snprintf(path, max_path, "%s/%lux", temp_path, time(NULL)); result = snprintf(path, max_path, "%s/%" PRIdMAX "x", temp_path, (intmax_t)time(NULL));
if (result < 0 || result >= max_path) { if (result < 0 || result >= max_path) {
rmdir(temp_path); rmdir(temp_path);
free(temp_path); free(temp_path);