mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Add minor improvements and cleanup
This commit is contained in:
parent
9e3e985ae5
commit
feed0d2b0e
163 changed files with 2286 additions and 2245 deletions
|
@ -49,16 +49,17 @@ void AppendWide(struct Buffer *b, wint_t wc) {
|
|||
} while (wb);
|
||||
}
|
||||
|
||||
void AppendFmt(struct Buffer *b, const char *fmt, ...) {
|
||||
int size;
|
||||
int AppendFmt(struct Buffer *b, const char *fmt, ...) {
|
||||
int bytes;
|
||||
char *tmp;
|
||||
va_list va;
|
||||
tmp = NULL;
|
||||
va_start(va, fmt);
|
||||
size = vasprintf(&tmp, fmt, va);
|
||||
bytes = vasprintf(&tmp, fmt, va);
|
||||
va_end(va);
|
||||
if (size != -1) AppendData(b, tmp, size);
|
||||
if (bytes != -1) AppendData(b, tmp, bytes);
|
||||
free(tmp);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue