RE: [gtk-list] Re: Need help

On 04-Jan-99 Alan Shutko wrote:
>>>>>> "J" == Johan Levin <> writes:
> J> A more generic way is to use, snprintf. Since the 'g_'-functions
> J> are glib-specific. (And I don't see why glib is better...)
> According to the man page I have, snprintf is a GNU extension, and
> would only be ther on systems with glibc.  A quick survey of the
> systems I have here says (rloging into them and doing man snprintf)
> DUnix:  Nope.
> Solaris: No.
> HPUX: No.
> AIX: No.
> Irix: Yes.
> So using the one in glib would be more portable.

It depends on what platforms one is aiming his or her sources.

from man snprintf(5) under FreeBSD-CURRENT

For safety, programmers should use the snprintf() interface instead. 
Unfortunately, this interface is not portable.

Then again, alot of range checking can be done with portable printf family
members. More code? Mayhaps. Portable? Most definately.

Jeroen Ruigrok van der Werven    A veil of smoke is what I am,
asmodai(at)                         I wait and I wait...
Network/Security Specialist      <>
BSD & picoBSD: The Power to Serve     <>

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]