Ethereal-dev: Re: [Ethereal-dev] Re: [Ethereal-cvs] rev 15264: /trunk/plugins/asn1/: packet-as

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Mon, 08 Aug 2005 23:23:30 +0200
Joerg Mayer wrote:

In case we don't use snprintf.h/c any more, maybe we should remove the
files from the sources.
Yes, that's what I intended.

But there are some hard cases left now, which needs some more investigation.

Unfortunately, the return values of the different snprintf() implementations vary if the given buffer is too short, to quote to GLib docs (http://developer.gnome.org/doc/API/2.0/glib/glib-String-Utility-Functions.html#g-snprintf):

"In versions of GLib prior to 1.2.3, this function may return -1 if the output was truncated, and the truncated string may not be nul-terminated. In versions prior to 1.3.12, this function returns the length of the output string.

The return value of g_snprintf() <cid:part1.07020603.02060201@web.de> conforms to the snprintf() function as standardized in ISO C99. Note that this is different from traditional snprintf(), which returns the length of the output string."


As the existing calls rely on the return values and I'm in doubt if this will work in all cases even today ...

Regards, ULFL