[PATCH BlueZ 3/3] tools: fix printf format strings

Christian Eggers
2022-09-23T10:52:17Z

time_t is 64 bit (long long) on many 32 bit platforms (e.g. ARM) now
---
tools/l2test.c | 5 +++--
tools/rctest.c | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/l2test.c b/tools/l2test.c
index fbaca747eaaa..5aae4b687518 100644
--- a/tools/l2test.c
+++ b/tools/l2test.c
@@ -893,8 +893,9 @@ static void recv_mode(int sk)
timestamp = 0;
memset(ts, 0, sizeof(ts));
} else {
- sprintf(ts, "[%ld.%ld] ",
- tv.tv_sec, tv.tv_usec);
+ sprintf(ts, "[%lld.%lld] ",
+ (long long)tv.tv_sec,
+ (long long)tv.tv_usec);
}
}

diff --git a/tools/rctest.c b/tools/rctest.c
index 9eb8210d6eb2..269503701e6b 100644
--- a/tools/rctest.c
+++ b/tools/rctest.c
@@ -500,8 +500,9 @@ static void recv_mode(int sk)
timestamp = 0;
memset(ts, 0, sizeof(ts));
} else {
- sprintf(ts, "[%ld.%ld] ",
- tv.tv_sec, tv.tv_usec);
+ sprintf(ts, "[%lld.%lld] ",
+ (long long)tv.tv_sec,
+ (long long)tv.tv_usec);
}
}

--
2.35.3