Commit: 0f0039045088e41f3cebea620ba9ef6d13592faf
Parent: f8219bccb485a23af7d61e4542fd4725c85e77bd
Author: Yao Zi <ziyao@disroot.org>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2025-03-26 17:05:34
Tree: 00ca145b8974a482e0baab8b0ccb622480c40ae0

client/gatt: Fix pointer assigned with character literal A character literl, '\0', is assigned to the pointer. The corresponding comment doesn't make any sense, since '\0' represents zero and this statement does the same thing as assigning value with NULL. Initializing value with NULL (or zero) is safe and correct here: the only case that the initial value of the pointer is passed to write_value() is that the if branch isn't executed, where len keeps its initial value, zero, as well. With src_len equal to zero, write_value() will bail out and src_val won't be dereferenced. Let's clean up the misleading comment and change right side of the assignment to fix compiler warnings about the wrong type, Fixes: ee750bbaf68c ("client/gatt: proxy_property_changed: check for NULL iterator") Acked-by: Christian Eggers <ceggers@arri.de>

Diffstat

M client/gatt.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)

View Full Diff | Patch