From 514414f6b3caed015176549a8ee75c456cd1567a Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Thu, 3 Sep 2015 17:39:33 -0700 Subject: [PATCH] Fix integer truncation issue in tag_to_timestamp(). Thanks to John Ilig for finding it. --- lib/preamble_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/preamble_impl.cc b/lib/preamble_impl.cc index da9143e..c52523d 100644 --- a/lib/preamble_impl.cc +++ b/lib/preamble_impl.cc @@ -128,7 +128,7 @@ static pmt::pmt_t tag_to_timestamp(gr::tag_t tstamp, uint64_t abs_sample_cnt, in double abs_frac = last_frac_stamp + frac_offset; if(abs_frac > 1.0f) { abs_frac -= 1.0f; - abs_whole += 1.0f; + abs_whole += 1; } tstime = pmt::make_tuple(pmt::from_uint64(abs_whole), pmt::from_double(abs_frac));