Update help prints to print the configured escape character

This commit is contained in:
Aaron Cook 2022-07-03 16:49:32 -05:00
commit 28d342aa42
4 changed files with 35 additions and 7 deletions

View file

@ -184,6 +184,29 @@ cheerios_info(const char *line)
return 0;
}
int
cheerios_print(const char *fmt, ...)
{
va_list ap;
char *buf;
size_t len;
va_start(ap, fmt);
len = vsnprintf(NULL, 0, fmt, ap);
va_end(ap);
buf = calloc(1, len+1);
va_start(ap, fmt);
vsprintf(buf, fmt, ap);
va_end(ap);
cheerios_insert(buf, len);
free(buf);
return 0;
}
int
cheerios_insert(const char *buf, size_t len)
{