Skip to content

Commit c594083

Browse files
vcgomesAnas Nashif
authored andcommitted
lib/zoap: Fix warning about signedness conversion
'query->value' is a 'const uint8_t *' so it should be casted to a char (signed) array before it is used in places where a 'char *' is expected, strncmp() is an example. Jira: ZEP-1810 Change-Id: I94cf780a40ad5fed29607d2302dc7a10387bb86f Signed-off-by: Vinicius Costa Gomes <[email protected]> (cherry picked from commit 98b35a72a162cf3f72f16c485cf9fe02f35ed4ab)
1 parent 746706d commit c594083

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

subsys/net/lib/zoap/zoap_link_format.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,9 @@ static bool match_queries_resource(const struct zoap_resource *resource,
206206
}
207207

208208
if (query->len > href_len + 1 &&
209-
!strncmp(query->value, "href", href_len)) {
210-
const char *uri = query->value + href_len + 1; /* href=... */
209+
!strncmp((char *) query->value, "href", href_len)) {
210+
/* The stuff after 'href=' */
211+
const char *uri = (char *) query->value + href_len + 1;
211212
uint16_t uri_len = query->len - (href_len + 1);
212213

213214
return match_path_uri(resource->path, uri, uri_len);

0 commit comments

Comments
 (0)