libluna: Treat a negative precision as if precision was omitted

This commit is contained in:
apio 2023-05-13 12:40:03 +02:00
parent 38541e22e9
commit e098a3269a
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -139,7 +139,10 @@ static usize parse_precision(const char** format, flags_t& flags, va_list ap)
const int precision = va_arg(ap, int);
if (precision >= 0) result = (usize)precision;
else
{
result = 0;
flags &= ~FLAG_USE_PRECISION;
}
(*format)++;
}
}