You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
345 B
C
21 lines
345 B
C
#include <stdarg.h>
|
|
#include "fmt.h"
|
|
|
|
size_t fmt_strm_internal(char* dest, ...) {
|
|
size_t n;
|
|
va_list a;
|
|
const char* s;
|
|
va_start(a,dest);
|
|
for (n=0; (s=va_arg(a,const char*)); ) {
|
|
size_t inc=fmt_str(dest,s);
|
|
if (n+inc<n) {
|
|
n=(size_t)-1;
|
|
break;
|
|
}
|
|
if (dest) dest+=inc;
|
|
n+=inc;
|
|
}
|
|
va_end(a);
|
|
return n;
|
|
}
|