From: Miroslav Lichvar Date: Mon, 28 Apr 2014 11:20:41 +0000 (+0200) Subject: cmdmon: fix doffset command with negative values on 64-bit systems X-Git-Tag: 1.30-pre1~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29c5ca909156c083442acd5b43402342e9cfde30;p=thirdparty%2Fchrony.git cmdmon: fix doffset command with negative values on 64-bit systems --- diff --git a/cmdmon.c b/cmdmon.c index e3ec9e09..b0567700 100644 --- a/cmdmon.c +++ b/cmdmon.c @@ -1378,8 +1378,8 @@ handle_doffset(CMD_Request *rx_message, CMD_Reply *tx_message) { long sec, usec; double doffset; - sec = (long)(ntohl(rx_message->data.doffset.sec)); - usec = (long)(ntohl(rx_message->data.doffset.usec)); + sec = (int32_t)ntohl(rx_message->data.doffset.sec); + usec = (int32_t)ntohl(rx_message->data.doffset.usec); doffset = (double) sec + 1.0e-6 * (double) usec; LOG(LOGS_INFO, LOGF_CmdMon, "Accumulated delta offset of %.6f seconds", doffset); LCL_AccumulateOffset(doffset, 0.0);