summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-06-07 15:00:30 -0400
committerJakob Kaivo <jkk@ung.org>2024-06-07 15:00:30 -0400
commit7dd69a0eddb6078e5d7c974f0e761a93eed5a202 (patch)
treea92dda4500fabc95fe515d72c62f93e0aaab6a95
parent1dc48f72aac96eacbdbb81920d6cf6bac61fe24b (diff)
reenable checking for invalid use of # and 0 flags
-rw-r--r--src/stdio/__conv.c7
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;
}