aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-11-11 13:00:20 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-11-11 13:00:20 +0100
commitc56781de33a257cc83978132dee0b28e2cbfc719 (patch)
tree13a53069210a223a1765842a8b8282c72d924977
parentd31d7709bdaee4323f0abf3a4fea25b4f1b1dcf6 (diff)
downloaddabmux-c56781de33a257cc83978132dee0b28e2cbfc719.tar.gz
dabmux-c56781de33a257cc83978132dee0b28e2cbfc719.tar.bz2
dabmux-c56781de33a257cc83978132dee0b28e2cbfc719.zip
Fix TAI bulletin parsing on systems where long is 32 bits
-rw-r--r--src/ClockTAI.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ClockTAI.cpp b/src/ClockTAI.cpp
index 8d693a2..875fce2 100644
--- a/src/ClockTAI.cpp
+++ b/src/ClockTAI.cpp
@@ -29,8 +29,8 @@
* so that correct time can be communicated in EDI timestamps.
*
* This file contains self-test code that can be executed by running
- * g++ -g -Wall -DTEST -DHAVE_CURL -std=c++11 -lcurl -pthread \
- * ClockTAI.cpp Log.cpp -o taitest && ./taitest
+ * g++ -g -Wall -DTEST -DHAVE_CURL -std=c++11 -lcurl -pthread \
+ * ClockTAI.cpp Log.cpp RemoteControl.cpp -lboost_system -o taitest && ./taitest
*/
#ifdef HAVE_CONFIG_H
@@ -299,7 +299,7 @@ int ClockTAI::parse_ietf_bulletin()
const string bulletin_offset(bulletin_entry[2]);
const int64_t timestamp_unix =
- std::atol(bulletin_ntp_timestamp.c_str()) - ntp_unix_offset;
+ std::atoll(bulletin_ntp_timestamp.c_str()) - ntp_unix_offset;
const int offset = std::atoi(bulletin_offset.c_str());
// Ignore entries announcing leap seconds in the future
@@ -406,7 +406,7 @@ int64_t ClockTAI::bulletin_expiry_delay() const
}
const string expiry_data_str(bulletin_entry[1]);
const int64_t expiry_unix =
- std::atol(expiry_data_str.c_str()) - ntp_unix_offset;
+ std::atoll(expiry_data_str.c_str()) - ntp_unix_offset;
if (expiry_unix > now) {
return expiry_unix - now;