jtag_tap: Make the MIN macro safer
authorSylvain Munaut <tnt@246tNt.com>
Tue, 8 Jun 2021 16:24:16 +0000 (18:24 +0200)
committerGregory Davill <greg.davill@gmail.com>
Wed, 9 Jun 2021 00:37:17 +0000 (10:07 +0930)
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
ecpprog/jtag_tap.c

index c4bdf4ebe9c54616ff610e044d4c8761a6571147..737bc010cfe1b97f86072a55f84652d5387d5943 100644 (file)
@@ -214,7 +214,7 @@ static void jtag_shift_bytes(
 }
 
 
-#define MIN(a,b) (a < b) ? a : b
+#define MIN(a,b) ((a) < (b)) ? (a) : (b)
 
 void jtag_tap_shift(
        uint8_t *input_data,