ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] strlen() and NULL pointer checks

From: Chris Maynard <chris.maynard@xxxxxxxxx>
Date: Mon, 16 May 2011 20:47:06 +0000 (UTC)
Jeff Morriss <jeff.morriss.ws@...> writes:

> Is there a better way?  Or better yet, a proper solution?

Not claiming this is better or proper, just another alternative:

epan/strutil.c:

#include <string.h>
size_t ws_strlen(const char *s)
{
    if (s == NULL)
        return 0;
    return strlen(s);
}