diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-06-22 11:16:18 -0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-06-22 11:16:18 -0700 |
commit | 7f92f75e88b66ba73db5a676c35c704e213dcd70 (patch) | |
tree | c3ab582ad9990eb507b08bea4799db48235c936e /client | |
parent | 33c96ca658fd7a0d358dd714decf465ff17ee043 (diff) | |
download | bluez-7f92f75e88b66ba73db5a676c35c704e213dcd70.tar.gz |
client/advertising: Fixes errors found by scan-build
This fixes the following errors:
client/advertising.c:129:4: warning: Value stored to 'n' is never read
[deadcode.DeadStores]
n = sizeof(str) - 1;
^ ~~~~~~~~~~~~~~~
client/advertising.c:1012:25: warning: Dereference of null pointer
(loaded from variable 'min') [core.NullDereference]
if (ad.min_interval != *min) {
^~~~
Diffstat (limited to 'client')
-rw-r--r-- | client/advertising.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/client/advertising.c b/client/advertising.c index f4678e978..5c9e3eeb3 100644 --- a/client/advertising.c +++ b/client/advertising.c @@ -125,8 +125,6 @@ static void print_uuid(const char *uuid) str[sizeof(str) - 3] = '.'; if (str[sizeof(str) - 4] == ' ') str[sizeof(str) - 4] = '.'; - - n = sizeof(str) - 1; } bt_shell_printf("UUID: %s(%s)\n", str, uuid); @@ -1009,13 +1007,13 @@ void ad_advertise_interval(DBusConnection *conn, uint32_t *min, uint32_t *max) return bt_shell_noninteractive_quit(EXIT_SUCCESS); } - if (ad.min_interval != *min) { + if (min && ad.min_interval != *min) { ad.min_interval = *min; g_dbus_emit_property_changed(conn, AD_PATH, AD_IFACE, "MinInterval"); } - if (ad.max_interval != *max) { + if (max && ad.max_interval != *max) { ad.max_interval = *max; g_dbus_emit_property_changed(conn, AD_PATH, AD_IFACE, "MaxInterval"); |