3e1db26a5a
Removing elvis, importing nvi, ctags, updating libedit. Change-Id: I881eb04d2dc64cf112facd992de1114e1a59107f
33 lines
551 B
C
33 lines
551 B
C
/* $NetBSD: vsnprintf.c,v 1.1.1.2 2008/05/18 14:29:39 aymeric Exp $ */
|
|
|
|
#include "config.h"
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#ifdef __STDC__
|
|
#include <stdarg.h>
|
|
#else
|
|
#include <varargs.h>
|
|
#endif
|
|
|
|
/*
|
|
* PUBLIC: #ifndef HAVE_VSNPRINTF
|
|
* PUBLIC: int vsnprintf __P((char *, size_t, const char *, ...));
|
|
* PUBLIC: #endif
|
|
*/
|
|
int
|
|
vsnprintf(str, n, fmt, ap)
|
|
char *str;
|
|
size_t n;
|
|
const char *fmt;
|
|
va_list ap;
|
|
{
|
|
#ifdef SPRINTF_RET_CHARPNT
|
|
(void)vsprintf(str, fmt, ap);
|
|
return (strlen(str));
|
|
#else
|
|
return (vsprintf(str, fmt, ap));
|
|
#endif
|
|
}
|