From: Alan T. DeKok Date: Thu, 2 Sep 2021 15:00:28 +0000 (-0400) Subject: use correct MOD macro. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90ac397e67d4cb758a1aa6e438154bcdd576e8db;p=thirdparty%2Ffreeradius-server.git use correct MOD macro. --- diff --git a/src/lib/util/value.c b/src/lib/util/value.c index 2f3db952063..31703de9cfa 100644 --- a/src/lib/util/value.c +++ b/src/lib/util/value.c @@ -5003,7 +5003,7 @@ ssize_t fr_value_box_print(fr_sbuff_t *out, fr_value_box_t const *data, fr_sbuff * The % operator can return a _signed_ value. This macro is * correct for both positive and negative inputs. */ -#define MOD(a,b) ((((a)%(b))+(b))%(b)) +#define MOD(a,b) (((a<0) ? (-a) : (a))%(b)) switch (res) { default: