From 7b8c2b3d6655f003f40079f3afb7cd288458e391 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 14 Apr 2020 13:22:38 +0200 Subject: lib/defaults: more bool confusion Sigh. Initializing a bool to -1 gives 1. Signed-off-by: David Lamparter --- lib/defaults.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/defaults.c') diff --git a/lib/defaults.c b/lib/defaults.c index 71ccc73cc6..4dcfe2899b 100644 --- a/lib/defaults.c +++ b/lib/defaults.c @@ -102,7 +102,7 @@ static bool frr_match_version(const char *name, const char *vspec, int cmp; static struct spec { const char *str; - bool dir, eq; + int dir, eq; } *s, specs[] = { {"<=", -1, 1}, {">=", 1, 1}, -- cgit v1.2.3 From d29c01db81cd55f09ec3de75b3df611e364bddc6 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 14 Apr 2020 13:23:57 +0200 Subject: lib/defaults: don't use "static" in a weird way This didn't break anything but it's not really correct either. Signed-off-by: David Lamparter --- lib/defaults.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/defaults.c') diff --git a/lib/defaults.c b/lib/defaults.c index 4dcfe2899b..7466aad5b1 100644 --- a/lib/defaults.c +++ b/lib/defaults.c @@ -100,10 +100,10 @@ static bool frr_match_version(const char *name, const char *vspec, const char *version, bool check) { int cmp; - static struct spec { + static const struct spec { const char *str; int dir, eq; - } *s, specs[] = { + } specs[] = { {"<=", -1, 1}, {">=", 1, 1}, {"==", 0, 1}, @@ -112,6 +112,7 @@ static bool frr_match_version(const char *name, const char *vspec, {"=", 0, 1}, {NULL, 0, 0}, }; + const struct spec *s; if (!vspec) /* NULL = all versions */ -- cgit v1.2.3