반응형
int
vsprintf(char *str, const char *fmt, __va_list ap)
#include <stdio.h> #include <string.h> #include <limits.h> #include "local.h" #if defined(APIWARN) __warn_references(vsprintf, "warning: vsprintf() is often misused, please use vsnprintf()"); #endif int vsprintf(char *str, const char *fmt, __va_list ap) { int ret; FILE f; struct __sfileext fext; _FILEEXT_SETUP(&f, &fext); f._file = -1; f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = INT_MAX; ret = vfprintf(&f, fmt, ap); *f._p = '\0'; return (ret); }
반응형