File: vsnprintf.c

package info (click to toggle)
nvi 1.79-25
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 5,396 kB
  • ctags: 3,767
  • sloc: ansic: 42,531; sh: 1,561; tcl: 1,124; makefile: 787; perl: 240; awk: 24; csh: 13
file content (31 lines) | stat: -rw-r--r-- 479 bytes parent folder | download | duplicates (29)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#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
}