Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: [Ethereal-dev] Why not use g_snprint() instead of snprintf() / NEED_SNPRINTF_H?

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: Thu, 11 Mar 2004 20:25:59 +0100
Hi List!

All over the code, something like:

#ifdef NEED_SNPRINTF_H
# include "snprintf.h"
#endif

in combination with snprintf() can be found.


Why not use GLIBs "String Utility Functions", and get rid of this setting?

snprintf -> g_snprintf
vsnprintf -> g_vsnprintf
...

This might also be true for some other (potentially unsecure) string functions like sprintf all over the code.


However, it may be necessary to keep some source files independant of the GLIB, but I don't see currently any place, where this might be the true.

Regards, ULFL