Commit 96c023df authored by Alexander Alashkin's avatar Alexander Alashkin Committed by rojer

Add zx/zd/zu support to c_vsnprintf

    PUBLISHED_FROM=83bf0e541a8541e484a83390108ca73d3af95c38
parent 44f37f49
...@@ -1786,6 +1786,11 @@ int c_vsnprintf(char *buf, size_t buf_size, const char *fmt, va_list ap) { ...@@ -1786,6 +1786,11 @@ int c_vsnprintf(char *buf, size_t buf_size, const char *fmt, va_list ap) {
} else if (ch == 'd' && len_mod == 'l') { } else if (ch == 'd' && len_mod == 'l') {
i += c_itoa(buf + i, buf_size - i, va_arg(ap, long), 10, flags, i += c_itoa(buf + i, buf_size - i, va_arg(ap, long), 10, flags,
field_width); field_width);
#ifdef SSIZE_MAX
} else if (ch == 'd' && len_mod == 'z') {
i += c_itoa(buf + i, buf_size - i, va_arg(ap, ssize_t), 10, flags,
field_width);
#endif
} else if (ch == 'd' && len_mod == 'q') { } else if (ch == 'd' && len_mod == 'q') {
i += c_itoa(buf + i, buf_size - i, va_arg(ap, int64_t), 10, flags, i += c_itoa(buf + i, buf_size - i, va_arg(ap, int64_t), 10, flags,
field_width); field_width);
...@@ -1795,6 +1800,9 @@ int c_vsnprintf(char *buf, size_t buf_size, const char *fmt, va_list ap) { ...@@ -1795,6 +1800,9 @@ int c_vsnprintf(char *buf, size_t buf_size, const char *fmt, va_list ap) {
} else if ((ch == 'x' || ch == 'u') && len_mod == 'l') { } else if ((ch == 'x' || ch == 'u') && len_mod == 'l') {
i += c_itoa(buf + i, buf_size - i, va_arg(ap, unsigned long), i += c_itoa(buf + i, buf_size - i, va_arg(ap, unsigned long),
ch == 'x' ? 16 : 10, flags, field_width); ch == 'x' ? 16 : 10, flags, field_width);
} else if ((ch == 'x' || ch == 'u') && len_mod == 'z') {
i += c_itoa(buf + i, buf_size - i, va_arg(ap, size_t),
ch == 'x' ? 16 : 10, flags, field_width);
} else if (ch == 'p') { } else if (ch == 'p') {
unsigned long num = (unsigned long) va_arg(ap, void *); unsigned long num = (unsigned long) va_arg(ap, void *);
C_SNPRINTF_APPEND_CHAR('0'); C_SNPRINTF_APPEND_CHAR('0');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment