Update help prints to print the configured escape character
This commit is contained in:
parent
38cde1611f
commit
28d342aa42
4 changed files with 35 additions and 7 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue