* [PATCH] nlmon: fix -Wformat under musl 1.2.0
@ 2020-04-02 2:16 Rosen Penev
2020-04-02 5:31 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2020-04-02 2:16 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 713 bytes --]
musl 1.2.0 uses 64-bit time, even under 32-bit OSes. Cast to int64_t
and use the proper macro.
---
monitor/nlmon.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/monitor/nlmon.c b/monitor/nlmon.c
index 0aeaea31..1f269ff0 100644
--- a/monitor/nlmon.c
+++ b/monitor/nlmon.c
@@ -216,8 +216,9 @@ static void print_packet(const struct timeval *tv, char ident,
ts_pos += n;
}
- n = sprintf(ts_str + ts_pos, " %lu.%06lu",
- tv->tv_sec - time_offset, tv->tv_usec);
+ n = sprintf(ts_str + ts_pos, " %" PRId64 ".%06" PRId64,
+ (int64_t)tv->tv_sec - time_offset,
+ (int64_t)tv->tv_usec);
if (n > 0) {
ts_pos += n;
ts_len += n;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nlmon: fix -Wformat under musl 1.2.0
2020-04-02 2:16 [PATCH] nlmon: fix -Wformat under musl 1.2.0 Rosen Penev
@ 2020-04-02 5:31 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2020-04-02 5:31 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 284 bytes --]
Hi Rosen,
On 4/1/20 9:16 PM, Rosen Penev wrote:
> musl 1.2.0 uses 64-bit time, even under 32-bit OSes. Cast to int64_t
> and use the proper macro.
> ---
> monitor/nlmon.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-02 5:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02 2:16 [PATCH] nlmon: fix -Wformat under musl 1.2.0 Rosen Penev
2020-04-02 5:31 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.