]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
wrap macro in `do { ... } while (0)` to shut up compiler
authorAlan T. DeKok <aland@freeradius.org>
Sun, 17 Jan 2021 14:07:14 +0000 (09:07 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 17 Jan 2021 14:07:14 +0000 (09:07 -0500)
src/lib/util/value.c

index 661c46092ce1f3960638f1f00ab1252563959ca5..475fcd8bb68ce78ba6db7835aeb47fa2270f7084 100644 (file)
@@ -558,8 +558,10 @@ int fr_value_box_cmp(fr_value_box_t const *a, fr_value_box_t const *b)
                /*
                 *      Short-hand for simplicity.
                 */
-#define CHECK(_type) if (a->datum._type < b->datum._type)   { compare = -1; \
-               } else if (a->datum._type > b->datum._type) { compare = +1; }
+#define CHECK(_type) do { \
+                       if (a->datum._type < b->datum._type)   { compare = -1; \
+                       } else if (a->datum._type > b->datum._type) { compare = +1; } \
+                    } while (0)                
 
        case FR_TYPE_BOOL:
                CHECK(boolean);