Skip to content

Commit

Permalink
fix: print timestamp in a portable way
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-roland committed Jul 11, 2024
1 parent 3c9f5a6 commit 46a2ccd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/unix/c11/z_sub_attachment.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
//

#include <ctype.h>
#include <inttypes.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
Expand Down Expand Up @@ -83,7 +84,7 @@ void data_handler(const z_loaned_sample_t *sample, void *ctx) {
// Check timestamp
const z_timestamp_t *ts = z_sample_timestamp(sample);
if (ts != NULL) {
printf(" with timestamp: %ld\n", z_timestamp_npt64_time(ts));
printf(" with timestamp: %" PRIu64 "\n", z_timestamp_npt64_time(ts));
}
// Check attachment
kv_pairs_t kvp = {.current_idx = 0, .len = KVP_LEN, .data = (kv_pair_t *)malloc(KVP_LEN * sizeof(kv_pair_t))};
Expand Down

0 comments on commit 46a2ccd

Please sign in to comment.