add smprint

This commit is contained in:
Charles Forsyth 2015-10-04 21:23:09 +01:00
parent e9f8c4353a
commit b53460e468
1 changed files with 17 additions and 0 deletions

17
print.c
View File

@ -85,3 +85,20 @@ seprint(char *buf, char *e, char *fmt, ...)
printcol = scol; printcol = scol;
return out; return out;
} }
char*
smprint(char *fmt, ...)
{
char buf[SIZE], *out;
va_list arg, temp;
int scol;
scol = printcol;
va_start(arg, fmt);
va_copy(temp, arg);
out = doprint(buf, buf+sizeof(buf), fmt, &temp);
va_end(temp);
va_end(arg);
printcol = scol;
return strdup(out);
}