diff options
author | Nicholas <nbnoll@eml.cc> | 2021-11-12 09:22:01 -0800 |
---|---|---|
committer | Nicholas <nbnoll@eml.cc> | 2021-11-12 09:22:01 -0800 |
commit | ce05175372a9ddca1a225db0765ace1127a39293 (patch) | |
tree | 5988b4d4f6b402e4953945886fc90aae11203df6 /src/libfmt/sprint.c | |
parent | b375f3cdedb5b0e08745d100b40e38d2f8396a58 (diff) |
chore: simplified organizational structurelaptop
Diffstat (limited to 'src/libfmt/sprint.c')
-rw-r--r-- | src/libfmt/sprint.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libfmt/sprint.c b/src/libfmt/sprint.c new file mode 100644 index 0000000..f1be6dd --- /dev/null +++ b/src/libfmt/sprint.c @@ -0,0 +1,19 @@ +#include "internal.h" + +int +fmt·sprint(char *buf, char *fmt, ...) +{ + int n; + uint len; + va_list args; + + len = 1 << 30; + if(buf+len < buf) + len = -(uintptr)buf-1; + + va_start(args, fmt); + n = fmt·vnsprint(len, buf, fmt, args); + va_end(args); + + return n; +} |