Samba 2.2.2 problem in lib/sprintf.c

Orwig, Paul PORWIG at PacificLife.com
Tue Oct 23 14:44:02 GMT 2001


I'm trying to compile Samba 2.2.2 for HPUX an ran into what looks like a
logic problem in the sprintf.c code.
The original code uses OR ( || ) and caused the new vsnprintf and snprintf
routines to be added despite being 
defined previously.

Below is the corrected code that has eliminated the errors.


#if !defined(HAVE_VSNPRINTF) && !defined(HAVE_C99_VSNPRINTF)
 int vsnprintf (char *str, size_t count, const char *fmt, va_list args)
{
        return dopr(str, count, fmt, args);
}
#endif

#if !defined(HAVE_SNPRINTF) && !defined(HAVE_C99_VSNPRINTF)
 int snprintf(char *str,size_t count,const char *fmt,...)
{
        size_t ret;
        va_list ap;

        va_start(ap, fmt);
        ret = vsnprintf(str, count, fmt, ap);
        va_end(ap);
        return ret;
}
#endif


Let me know if this breaks something or is just an untested feature!

Paul Orwig
Pacific Life




More information about the samba-technical mailing list