ref: a71ef347b03036c8e0a175f4084bc2440d0751e0
dir: /snprintandf.c/
#include <u.h> #include <libc.h> #include <stdio.h> void main() { char *s; int l; s = malloc(128); l = snprint(s, 128, "%s%s", "hi", "there"); print("%s(%d)\n", s, l); l = snprintf(s, 128, "%s%s", "hi", "there"); print("%s(%d)\n", s, l); free(s); exits(0); }