From 625e32737ada0e22062774c9f8e8950acb075ba8 Mon Sep 17 00:00:00 2001 From: b Date: Wed, 10 Aug 2022 00:29:30 +0200 Subject: [PATCH] fix limit check in calculation encoding --- libstaf.c | 8 ++++---- libstaf.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libstaf.c b/libstaf.c index fe24457..155ae9b 100644 --- a/libstaf.c +++ b/libstaf.c @@ -1,8 +1,8 @@ -// SilentTimer Action Figure communication library, v1.0 +// SilentTimer Action Figure communication library, v1.1 // libstaf.c // -// 14.12.2020 -// Copyright (C) 2020 Balthasar Szczepański +// 09.08.2022 +// Copyright (C) 2020, 2022 Balthasar Szczepański // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -1230,7 +1230,7 @@ int stafEncodeCalculationArgument (float in, uint8_t *out, uint8_t *flags) return ERR_INVALID_PARAMETER; fraction = in*100.0; - if(fraction>limit) + if(fraction>=limit) bcd = stafEncodeBcdU16((uint16_t)(in+0.5)); else { diff --git a/libstaf.h b/libstaf.h index e094ea0..20ed7e2 100644 --- a/libstaf.h +++ b/libstaf.h @@ -1,5 +1,5 @@ // SilentTimer Action Figure communication library -// libstaf.h, v1.0 +// libstaf.h, v1.1 // // 03.07.2020 // Copyright (C) 2020 Balthasar Szczepański -- 2.30.2