From d3f41358767d95f2fe84e0e1fc9e4e080049582a Mon Sep 17 00:00:00 2001 From: Jian Zhang Date: Mon, 13 Jan 2025 13:13:38 +0800 Subject: [PATCH] examples: fix print warning on 32-bit systems Changed the format specifier in snprintf to use PRIu64 for compatibility with 32-bit systems. Signed-off-by: Jian Zhang --- examples/telemetry-listen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/telemetry-listen.c b/examples/telemetry-listen.c index 9aae8b07..2a745799 100644 --- a/examples/telemetry-listen.c +++ b/examples/telemetry-listen.c @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -50,7 +51,7 @@ static void save_telemetry(nvme_ctrl_t c) return; s = time(NULL); - ret = snprintf(buf, sizeof(buf), "/var/log/%s-telemetry-%ld", + ret = snprintf(buf, sizeof(buf), "/var/log/%s-telemetry-%" PRIu64, nvme_ctrl_get_subsysnqn(c), s); if (ret < 0) { free(log);