vsnprintf2.c

Go to the documentation of this file.
00001 /*-
00002  * See the file LICENSE for redistribution information.
00003  *
00004  * Copyright (c) 1996, 1997, 1998, 1999
00005  *      Sleepycat Software.  All rights reserved.
00006  */
00007 
00008 #ifdef HAVE_CONFIG_H
00009 #include "config.h"
00010 #endif /* HAVE_CONFIG_H */
00011 
00012 #ifndef HAVE_VSNPRINTF
00013 
00014 #ifndef NO_SYSTEM_INCLUDES
00015 #include <sys/types.h>
00016 
00017 #include <stdio.h>
00018 #ifdef __STDC__
00019 #include <stdarg.h>
00020 #else
00021 #include <varargs.h>
00022 #endif
00023 #endif
00024 
00025 /*
00026  * vsnprintf --
00027  *      Bounded version of vsprintf.
00028  *
00029  * PUBLIC: #ifndef HAVE_VSNPRINTF
00030  * PUBLIC: int vsnprintf();
00031  * PUBLIC: #endif
00032  */
00033 
00034 int
00035 vsnprintf(str, n, fmt, ap)
00036         char *str;
00037         size_t n;
00038         const char *fmt;
00039         va_list ap;
00040 {
00041         n = 0;
00042 
00043 #ifdef SPRINTF_RET_CHARPNT
00044         (void)vsprintf(str, fmt, ap);
00045         return (strlen(str));
00046 #else
00047         return (vsprintf(str, fmt, ap));
00048 #endif
00049 }
00050 #endif /* HAVE_VSNPRINTF */
00051 

Generated on Sun Jun 8 10:56:34 2008 for GNUmifluz by  doxygen 1.5.5