From d79cb1c9986e6c660f73bb5086d838a315d260e9 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Thu, 7 Nov 2013 00:13:56 +0100 Subject: [PATCH] Fix BCD decoding bug --- mbus/mbus-protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mbus/mbus-protocol.c b/mbus/mbus-protocol.c index aae3624..968ace1 100755 --- a/mbus/mbus-protocol.c +++ b/mbus/mbus-protocol.c @@ -2380,8 +2380,8 @@ mbus_data_record_decode(mbus_data_record *record) case 0x0E: // 12 digit BCD (48 bit) - float_val = mbus_data_bcd_decode(record->data, 6); - snprintf(buff, sizeof(buff), "%lld", float_val); + long_long_val = mbus_data_bcd_decode(record->data, 6); + snprintf(buff, sizeof(buff), "%lld", long_long_val); if (debug) printf("%s: DIF 0x%.2x was decoded using 12 digit BCD\n", __PRETTY_FUNCTION__, record->drh.dib.dif);