]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
conf+cmdparse: parenthesize all macro arguments
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 19 May 2025 12:33:39 +0000 (14:33 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 21 May 2025 10:41:13 +0000 (12:41 +0200)
cmdparse.c
conf.c

index 9202d76cf9a592e98bf5ec513cfc98169666a6b6..e84bca9d13d0816d7ca9384bf144b5586fe36a60 100644 (file)
@@ -40,7 +40,7 @@
 /* ================================================== */
 
 #define SSCANF_IN_RANGE(s, f, x, n, min, max) \
-  (sscanf(s, f, (x), (n)) == 1 && *(x) >= (min) && *(x) <= (max))
+  (sscanf((s), (f), (x), (n)) == 1 && *(x) >= (min) && *(x) <= (max))
 
 /* ================================================== */
 
diff --git a/conf.c b/conf.c
index 1e023fca1386c5a5d4693503211e79de4e530407..cd3466b88a9e8f8ba290a19711192bb2e3212cd9 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -51,7 +51,7 @@
 #define MAX_INCLUDE_LEVEL 10
 
 #define SSCANF_IN_RANGE(s, f, x, n, min, max) \
-  (sscanf(s, f, (x), (n)) == 1 && *(x) >= (min) && *(x) <= (max))
+  (sscanf((s), (f), (x), (n)) == 1 && *(x) >= (min) && *(x) <= (max))
 
 /* ================================================== */
 /* Forward prototypes */