openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/nss-pam-ldapd/0.9.8-r0/nss-pam-ldapd-0.9.8/nslcd/common.c
int mysnprintf(char* buffer, size_t buflen, const char* format, ...)
{
    int res;
    va_list ap;
    /* do snprintf */
    va_start(ap, format);
    res = vsnprintf(buffer, buflen, format, ap);
    va_end(ap);
    /* NULL-terminate the string just to be on the safe side */
    buffer[buflen - 1] = '\0';
    /* check if the string was completely written */
    return ((res < 0) || (((size_t)res) >= buflen));
}
/* simple wrapper around snptintf() to return non-zero in case
   of any failure (but always keep string 0-terminated) */
simple wrapper around snptintf() to return non-zero in case
of any failure (but always keep string 0-terminated)
simple wrapper around snptintf () to return non - zero in case of any failure ( but always keep string 0 - terminated )
int mysnprintf(char* buffer, size_t buflen, const char* format, ...)
{
    int res;
    va_list ap;
    va_start(ap, format);
    res = vsnprintf(buffer, buflen, format, ap);
    va_end(ap);
    buffer[buflen - 1] = '\0';
    return ((res < 0) || (((size_t)res) >= buflen));
}
int mysnprintf ( char * buffer , size_t buflen , const char * format , ... ) { int res ; va_list ap ; va_start ( ap , format ) ; res = vsnprintf ( buffer , buflen , format , ap ) ; va_end ( ap ) ; buffer [ buflen - 1 ] = ' \0 ' ; return ( ( res < 0 ) || ( ( ( size_t ) res ) >= buflen ) ) ; }
simple wrapper around snptintf() to return non-zero in case
of any failure (but always keep string 0-terminated)
simple wrapper around snptintf () to return non - zero in case of any failure ( but always keep string 0 - terminated )
/* do snprintf */ /* NULL-terminate the string just to be on the safe side */ /* check if the string was completely written */