Fix warnings reported by clang-10 static analyzer
authorPetr Štetiar <ynezz@true.cz>
Sun, 11 Oct 2020 08:45:15 +0000 (10:45 +0200)
committerPetr Štetiar <ynezz@true.cz>
Tue, 27 Oct 2020 22:03:04 +0000 (23:03 +0100)
commit8e5719b37a67925674bb3c5524a1ad3fa138a064
treebe173c9fd23a110d82b28aa01119fb155daac6fd
parentb99aa8a64cca4d6d6adc8ce3b851ca1e9a56bdf5
Fix warnings reported by clang-10 static analyzer

Fixes following warnings:

 testing/include/libubox/blobmsg.h:222:67: warning: Null pointer passed to 1st parameter expecting 'nonnull'
         return blobmsg_add_field(buf, BLOBMSG_TYPE_STRING, name, string, strlen(string) + 1);
                                                                         ^~~~~~~~~~~~~~
 cgi-io/main.c:407:4: warning: Null pointer passed to 1st parameter expecting 'nonnull'
                         unlink(st.filename);
                         ^~~~~~~~~~~~~~~~~~~

 cgi-io/main.c:876:26: warning: Null pointer passed to 1st parameter expecting 'nonnull'
         size_t plen = 0, clen = strlen(cmd) + 1;
                                 ^~~~~~~~~~~

Signed-off-by: Petr Štetiar <ynezz@true.cz>
main.c