Changeset c7c6afd in mainline for uspace/lib/c/generic/io/asprintf.c
- Timestamp:
- 2025-04-13T23:27:44Z (4 weeks ago)
- Children:
- b6061f8c
- Parents:
- 240b2e4 (diff), f5e1692 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Wayne Thornton <wmthornton-dev@…> (2025-04-13 23:27:44)
- git-committer:
- GitHub <noreply@…> (2025-04-13 23:27:44)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/asprintf.c
r240b2e4 rc7c6afd 40 40 #include <str.h> 41 41 #include <printf_core.h> 42 43 static int asprintf_str_write(const char *str, size_t count, void *unused)44 {45 return str_nlength(str, count);46 }47 48 static int asprintf_wstr_write(const char32_t *str, size_t count, void *unused)49 {50 return wstr_nlength(str, count);51 }52 53 int vprintf_length(const char *fmt, va_list args)54 {55 printf_spec_t ps = {56 asprintf_str_write,57 asprintf_wstr_write,58 NULL59 };60 61 return printf_core(fmt, &ps, args);62 }63 64 int printf_length(const char *fmt, ...)65 {66 va_list args;67 va_start(args, fmt);68 int ret = vprintf_length(fmt, args);69 va_end(args);70 71 return ret;72 }73 42 74 43 /** Allocate and print to string. … … 115 84 int ret = vasprintf(strp, fmt, args); 116 85 va_end(args); 117 118 86 return ret; 119 87 }
Note:
See TracChangeset
for help on using the changeset viewer.