[BlueZ PATCH] main: fixing logical error when loading controller params

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixing logical error when loading configuration parameters from the
config file.  Without this patch, the maximum allowable value is always
used.

---

 src/main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main.c b/src/main.c
index e51f614b3..75ea27f40 100644
--- a/src/main.c
+++ b/src/main.c
@@ -421,12 +421,13 @@ static void parse_controller_config(GKeyFile *config)
 		int val = g_key_file_get_integer(config, "Controller",
 						params[i].val_name, &err);
 		if (err) {
+			warn("%s", err->message);
 			g_clear_error(&err);
 		} else {
-			DBG("%s=%d", params[i].val_name, val);
+			info("%s=%d", params[i].val_name, val);
 
-			val = MIN(val, params[i].min);
-			val = MAX(val, params[i].max);
+			val = MAX(val, params[i].min);
+			val = MIN(val, params[i].max);
 			*params[i].val = val;
 			++main_opts.default_params.num_entries;
 		}
-- 
2.27.0.111.gc72c7da667-goog




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux