mariadb/bdb/clib/vsnprintf.c

48 lines
834 B
C
Raw Normal View History

2001-03-04 19:42:05 -05:00
/*-
* See the file LICENSE for redistribution information.
*
2002-10-30 15:57:05 +04:00
* Copyright (c) 1996-2002
2001-03-04 19:42:05 -05:00
* Sleepycat Software. All rights reserved.
*/
#include "db_config.h"
#ifndef lint
2002-10-30 15:57:05 +04:00
static const char revid[] = "$Id: vsnprintf.c,v 11.7 2002/01/11 15:51:29 bostic Exp $";
2001-03-04 19:42:05 -05:00
#endif /* not lint */
#ifndef NO_SYSTEM_INCLUDES
#include <sys/types.h>
#include <stdio.h>
#endif
#include "db_int.h"
/*
* vsnprintf --
* Bounded version of vsprintf.
*
* PUBLIC: #ifndef HAVE_VSNPRINTF
2002-10-30 15:57:05 +04:00
* PUBLIC: int vsnprintf __P((char *, size_t, const char *, va_list));
2001-03-04 19:42:05 -05:00
* PUBLIC: #endif
*/
#ifndef HAVE_VSNPRINTF
int
vsnprintf(str, n, fmt, ap)
char *str;
size_t n;
const char *fmt;
va_list ap;
{
COMPQUIET(n, 0);
#ifdef SPRINTF_RET_CHARPNT
(void)vsprintf(str, fmt, ap);
return (strlen(str));
#else
return (vsprintf(str, fmt, ap));
#endif
}
#endif