[vlc-devel] [PATCH 1/2] help: fix float lower bound check
Lyndon Brown
jnqnfe at gmail.com
Wed Sep 30 21:19:31 CEST 2020
preview:
From: Lyndon Brown <jnqnfe at gmail.com>
Date: Sun, 31 Mar 2019 07:23:19 +0100
Subject: help: fix float lower bound check
needs to check -FLT_MAX not FLT_MIN, as explained in
c95d5fbea2122ac471f8aee86ee9f1cafeddeb00
that commit overlooked this and introduced a bug in 3.x whereby help output
would always print the range for float options with default ranges,
resulting in much messier output than expected.
diff --git a/src/config/help.c b/src/config/help.c
index 9e013da29b..9d3c2ade2b 100644
--- a/src/config/help.c
+++ b/src/config/help.c
@@ -472,7 +472,7 @@ static void print_item(const module_t *m, const module_config_t *item,
}
case CONFIG_ITEM_FLOAT:
type = _("float");
- if (item->min.f != FLT_MIN || item->max.f != FLT_MAX)
+ if (item->min.f != -FLT_MAX || item->max.f != FLT_MAX)
{
if (asprintf(&typebuf, "%s [%f .. %f]", type,
item->min.f, item->max.f) >= 0)
More information about the vlc-devel
mailing list