net: zoap: Remove extra null checks
No need to check attr and path variables for null as they cannot be null. Coverity-CID: 157595 Coverity-CID: 157602 Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
3677caa37e
commit
4f68e32b8a
1 changed files with 4 additions and 4 deletions
|
@ -272,7 +272,7 @@ static int format_uri(const char * const *path, struct net_buf *buf,
|
|||
return 0;
|
||||
}
|
||||
|
||||
for (p = path; p && *p; ) {
|
||||
for (p = path; *p; ) {
|
||||
u16_t path_len = strlen(*p);
|
||||
|
||||
add_to_net_buf(buf, *p, path_len,
|
||||
|
@ -313,7 +313,7 @@ static int format_attributes(const char * const *attributes,
|
|||
goto terminator;
|
||||
}
|
||||
|
||||
for (attr = attributes; attr && *attr; ) {
|
||||
for (attr = attributes; *attr; ) {
|
||||
int attr_len = strlen(*attr);
|
||||
|
||||
add_to_net_buf(buf, *attr, attr_len,
|
||||
|
@ -539,7 +539,7 @@ static int format_uri(const char * const *path, struct net_buf *buf)
|
|||
str = net_buf_add(buf, sizeof(prefix) - 1);
|
||||
strncpy(str, prefix, sizeof(prefix) - 1);
|
||||
|
||||
for (p = path; p && *p; ) {
|
||||
for (p = path; *p; ) {
|
||||
u16_t path_len = strlen(*p);
|
||||
|
||||
str = net_buf_add(buf, path_len);
|
||||
|
@ -568,7 +568,7 @@ static int format_attributes(const char * const *attributes,
|
|||
goto terminator;
|
||||
}
|
||||
|
||||
for (attr = attributes; attr && *attr; ) {
|
||||
for (attr = attributes; *attr; ) {
|
||||
int attr_len = strlen(*attr);
|
||||
|
||||
str = net_buf_add(buf, attr_len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue