aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Paland <marco@paland.com>2018-09-24 15:12:00 +0200
committerMarco Paland <marco@paland.com>2018-09-24 15:12:00 +0200
commit25958b9beb1830eb79033d6095a64f4c5f87effa (patch)
treec534a2c9155d1d599a339fb1eb165f1d5abd3473
parentc235b5cd6eb541f87de4ff76487ca39c20153f5b (diff)
downloadprintf-25958b9beb1830eb79033d6095a64f4c5f87effa.tar.gz
printf-25958b9beb1830eb79033d6095a64f4c5f87effa.tar.bz2
printf-25958b9beb1830eb79033d6095a64f4c5f87effa.zip
fix(printf): fix hash precision
Fixes #31
-rw-r--r--printf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/printf.c b/printf.c
index a7a3d68..e4cb328 100644
--- a/printf.c
+++ b/printf.c
@@ -163,7 +163,7 @@ static size_t _ntoa_format(out_fct_type out, char* buffer, size_t idx, size_t ma
// handle hash
if (flags & FLAGS_HASH) {
- if (len && ((len == prec) || (len == width))) {
+ if (!(flags & FLAGS_PRECISION) && len && ((len == prec) || (len == width))) {
len--;
if (len && (base == 16U)) {
len--;