Skip to content

Commit e3c2029

Browse files
committed
examples: fix time stamp prefix printf format string
The simples way to print time_t for 32bit and 64bit is to cast it to unsigned long long. We could also use the time_t helpers for generating a filename but that seems overkill for the example. Signed-off-by: Daniel Wagner <[email protected]>
1 parent 8ad28af commit e3c2029

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

examples/telemetry-listen.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ static void save_telemetry(nvme_ctrl_t c)
5050
return;
5151

5252
s = time(NULL);
53-
ret = snprintf(buf, sizeof(buf), "/var/log/%s-telemetry-%ld",
54-
nvme_ctrl_get_subsysnqn(c), s);
53+
ret = snprintf(buf, sizeof(buf), "/var/log/%s-telemetry-%llu",
54+
nvme_ctrl_get_subsysnqn(c), (unsigned long long)s);
5555
if (ret < 0) {
5656
free(log);
5757
return;

0 commit comments

Comments
 (0)