aboutsummaryrefslogtreecommitdiffstats
path: root/printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'printf.c')
-rw-r--r--printf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/printf.c b/printf.c
index e4cb328..d932dba 100644
--- a/printf.c
+++ b/printf.c
@@ -175,6 +175,9 @@ static size_t _ntoa_format(out_fct_type out, char* buffer, size_t idx, size_t ma
if ((base == 16U) && (flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
buf[len++] = 'X';
}
+ if ((base == 2U) && (len < PRINTF_NTOA_BUFFER_SIZE)) {
+ buf[len++] = 'b';
+ }
if (len < PRINTF_NTOA_BUFFER_SIZE) {
buf[len++] = '0';
}
@@ -535,7 +538,6 @@ static int _vsnprintf(out_fct_type out, char* buffer, const size_t maxlen, const
}
else if (*format == 'b') {
base = 2U;
- flags &= ~FLAGS_HASH; // no hash for bin format
}
else {
base = 10U;