Skip to content

Commit

Permalink
isobusfs_cmn: isobusfs_get_timeout_ms(): fix print on 32 bit archs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
marckleinebudde committed Feb 13, 2024
1 parent e547c32 commit 7c56863
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion isobusfs/isobusfs_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
Expand Down Expand Up @@ -137,7 +138,7 @@ int isobusfs_get_timeout_ms(struct timespec *ts)
timeout_ms = 0;
} else {
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;
}

Expand Down

0 comments on commit 7c56863

Please sign in to comment.