isobusfs_cmn: isobusfs_get_timeout_ms(): fix print on 32 bit archs

Fixes the following warning:

| isobusfs/isobusfs_cmn.c: In function 'isobusfs_get_timeout_ms':
| isobusfs/isobusfs_cmn.c:140:51: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'int64_t' {aka 'long long int'} [-Wformat=]
|   140 |                         warn("timeout too long: %ld ms", time_diff);
|       |                                                 ~~^      ~~~~~~~~~
|       |                                                   |      |
|       |                                                   |      int64_t {aka long long int}
|       |                                                   long int
|       |                                                 %lld
pull/496/head
Marc Kleine-Budde 2024-02-13 14:08:27 +01:00
parent e547c3241e
commit 7c56863047
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@
#include <ctype.h> #include <ctype.h>
#include <err.h> #include <err.h>
#include <errno.h> #include <errno.h>
#include <inttypes.h>
#include <limits.h> #include <limits.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
@ -137,7 +138,7 @@ int isobusfs_get_timeout_ms(struct timespec *ts)
timeout_ms = 0; timeout_ms = 0;
} else { } else {
if (time_diff > INT_MAX) { if (time_diff > INT_MAX) {
warn("timeout too long: %ld ms", time_diff); warn("timeout too long: %" PRId64 " ms", time_diff);
time_diff = INT_MAX; time_diff = INT_MAX;
} }