From 11bdf9e8a5342d54947d4aace0ce93f8808727d9 Mon Sep 17 00:00:00 2001 From: Philip Balister Date: Thu, 29 Sep 2016 11:32:26 -0700 Subject: Fix warning in rx_samples_c.c. time_t is not guaranteed to be printable as in int type. Use difftime to portably convert time_t to float and print result. Signed-off-by: Philip Balister --- host/examples/rx_samples_c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host/examples/rx_samples_c.c b/host/examples/rx_samples_c.c index 0ecb89153..d269e29b7 100644 --- a/host/examples/rx_samples_c.c +++ b/host/examples/rx_samples_c.c @@ -233,9 +233,9 @@ int main(int argc, char* argv[]) time_t full_secs; double frac_secs; uhd_rx_metadata_time_spec(md, &full_secs, &frac_secs); - fprintf(stderr, "Received packet: %zu samples, %zu full secs, %f frac secs\n", + fprintf(stderr, "Received packet: %zu samples, %.f full secs, %f frac secs\n", num_rx_samps, - full_secs, + difftime(full_secs, (time_t) 0), frac_secs); } -- cgit v1.2.3