diff options
Diffstat (limited to 'printf.c')
-rw-r--r-- | printf.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -464,7 +464,8 @@ static int _vsnprintf(out_fct_type out, char* buffer, const size_t maxlen, const precision = _atoi(&format);
}
else if (*format == '*') {
- precision = (unsigned int)va_arg(va, int);
+ const int prec = (int)va_arg(va, int);
+ precision = prec > 0 ? (unsigned int)prec : 0U;
format++;
}
}
|