diff options
author | Jakob Kaivo <jkk@ung.org> | 2024-06-07 15:00:30 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2024-06-07 15:00:30 -0400 |
commit | 7dd69a0eddb6078e5d7c974f0e761a93eed5a202 (patch) | |
tree | a92dda4500fabc95fe515d72c62f93e0aaab6a95 | |
parent | 1dc48f72aac96eacbdbb81920d6cf6bac61fe24b (diff) |
reenable checking for invalid use of # and 0 flags
-rw-r--r-- | src/stdio/__conv.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/stdio/__conv.c b/src/stdio/__conv.c index 2b317400..b48c455b 100644 --- a/src/stdio/__conv.c +++ b/src/stdio/__conv.c @@ -161,5 +161,12 @@ size_t __conv(const char *format, struct io_conversion *conv, va_list arg) UNDEFINED_FMT(conv, "Unknown conversion specifier '%c'", conv->spec); } + if ((conv->flags & F_ALT) && !strchr("xXaAeEfFgG", conv->spec)) { + UNDEFINED_FMT(conv, "Flag '#' is not supported with conversion specifier '%c'", conv->spec); + } + if ((conv->flags & F_ZERO) && !strchr("diouxXaAeEfFgG", conv->spec)) { + UNDEFINED_FMT(conv, "Flag '0' is not supported with conversion specifier '%c'", conv->spec); + } + return ret; } |