ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] g_snprintf() and sizeof

From: Stephen Fisher <steve@xxxxxxxxxxxxxxxxxx>
Date: Thu, 19 Mar 2009 14:54:19 -0600
On Thu, Mar 19, 2009 at 03:09:22PM -0400, Bill Meier wrote:

> As you know, sizeof is used in *many* places in Wireshark when calling 
> g_snprint. This was true even before the recent changes.
> 
> Is there any other approach than adding an explicit cast to each and 
> every usage of sizeof when calling g_snprintf & friends ??
> 
> Thoughts ??

Stop using fixed length strings so much? :-)

Even if we cast them now, I can see people adding sizeof in the future 
and forgetting to cast it.  GLib doesn't appear to have any other 
solution.


Steve