Skip to content

Commit 388023f

Browse files
committed
net: coap: Remove resource pointer NULL check
This commit removes the resource pointer NULL check inside the resource enumeration loop of the `coap_well_known_core_get` function because the expression `(resource + 1)` will never evaluate to NULL (aka. 0). This fixes the "comparison will always evaluate as ‘true’ for the pointer operand" warning generated by the GCC 12. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
1 parent dd36024 commit 388023f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/net/lib/coap/coap_link_format.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ int coap_well_known_core_get(struct coap_resource *resource,
687687
return r;
688688
}
689689

690-
if ((resource + 1) && (resource + 1)->path) {
690+
if ((resource + 1)->path) {
691691
r = append_u8(response, (uint8_t) ',');
692692
if (!r) {
693693
return -ENOMEM;

0 commit comments

Comments
 (0)