MaJerle / lwprintf

Lightweight printf library optimized for embedded systems
https://majerle.eu/projects/lwprintf-lightweight-stdio-manager-printf-snprintf-vprintf-vsnprintf-sprintf
MIT License
186 stars 32 forks source link

Same statements #6

Closed DmiKarasev closed 3 years ago

DmiKarasev commented 3 years ago

https://github.com/MaJerle/lwprintf/blob/aa3813258d0bd10ddd0ea4751841789335da9c45/lwprintf/src/lwprintf/lwprintf.c#L1032

Tilen, look at lines 1032-1034: if (...) { ... } else if (p->m.flags.sz_t) { action1(); } else if (p->m.flags.sz_t) { action2(); }

In this case, the prv_umaxt_to_str(p, (uintmax_t)va_arg(arg, uintmax_t)) function will never get control

I suppose there should be } else if (p->m.flags.uintmax_t) { on line 1034

MaJerle commented 3 years ago

Thanks, fixed on develop branch.