-/*
- * modified from Sten Gunterberg's BUGTRAQ post of 22 Jul 1997
- * --nathan bryant <bryant@cs.usm.maine.edu>
- *
- * $Id$
- */
-
/*
* Replacements for snprintf() and vsnprintf()
*
+ * modified from Sten Gunterberg's BUGTRAQ post of 22 Jul 1997
+ * --nathan bryant <nathan@designtrust.com>
+ *
* Use it only if you have the "spare" cycles needed to effectively
* do every snprintf operation twice! Why is that? Because everything
* is first vfprintf()'d to /dev/null to determine the number of bytes.
return vfprintf(sink, fmt, argp);
}
-int
-snprintf (char *buf, size_t max, const char *fmt, ...)
-{
- va_list argp;
- int bytes;
-
- va_start(argp, fmt);
- bytes = vsnprintf(buf, max, fmt, argp);
- va_end(argp);
-
- return bytes;
-}
-
int
vsnprintf (char *buf, size_t max, const char *fmt, va_list argp)
{
free(p);
return size;
}
+
+int
+snprintf (char *buf, size_t max, const char *fmt, ...)
+{
+ va_list argp;
+ int bytes;
+
+ va_start(argp, fmt);
+ bytes = vsnprintf(buf, max, fmt, argp);
+ va_end(argp);
+
+ return bytes;
+}