Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce07b6fa authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "fix warning: Null pointer argument in call to memory comparison function"

parents 71c09931 33f67178
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -561,11 +561,13 @@ bool NetlinkEvent::parseBinaryNetlinkMessage(char *buffer, int size) {
static const char*
has_prefix(const char* str, const char* end, const char* prefix, size_t prefixlen)
{
    if ((end-str) >= (ptrdiff_t)prefixlen && !memcmp(str, prefix, prefixlen))
    if ((end - str) >= (ptrdiff_t)prefixlen &&
        (prefixlen == 0 || !memcmp(str, prefix, prefixlen))) {
        return str + prefixlen;
    else
    } else {
        return NULL;
    }
}

/* Same as strlen(x) for constant string literals ONLY */
#define CONST_STRLEN(x)  (sizeof(x)-1)