Files
mars-libowfat/fmt/fmt_strm_internal.c
leitner ea2b3e6c6f updates makefile dependencies
remove compiler.h include from tryinline.c
add #ifdef INTERNAL to files included by n.c and ent.c so they don't need headers in libowfat/ and can compile without an installed or build libowfat
2025-01-22 17:32:17 +00:00

23 lines
378 B
C

#include <stdarg.h>
#ifndef INTERNAL
#include <libowfat/fmt.h>
#endif
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;
}