diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2022-08-03 15:27:11 -0300 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2022-08-03 15:27:11 -0300 |
commit | 44cfcd337ad418e613c6434c181dafe5bf67057e (patch) | |
tree | 979199c4c6ed90bf49fbde195731e5a53ef2b2d3 /misc.c | |
parent | ca4284c2160617bb57292f56ba6b9bd7fc0814db (diff) |
misc: Add `vformat_len()`
This works exactly like `format_len()`, except that it uses `va_list`
rather than variadic arguments.
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -201,6 +201,10 @@ char *skip_whitespace(const char *str) { } } +int vformat_len(const char *fmt, va_list args) { + return vsnprintf(NULL, 0, fmt, args); +} + int format_len(const char *fmt, ...) { int len = 0; va_list args; |