prf.c: don't be silent with unknown conversion specifiers

Mimic the glibc behavior when encountering an unknown conversion
specifier rather than silently skipping it.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
Nicolas Pitre 2019-06-19 22:38:21 -04:00 committed by Anas Nashif
commit 4ad2a8f990

View file

@ -737,6 +737,12 @@ int z_prf(int (*func)(), void *dest, const char *format, va_list vargs)
count++;
break;
default:
PUTC('%');
PUTC(c);
count += 2;
break;
case 0:
return count;
}