Skip to content

Commit

Permalink
prf.c: don't be silent with unknown conversion specifiers
Browse files Browse the repository at this point in the history
Mimic the glibc behavior when encountering an unknown conversion
specifier rather than silently skipping it.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
  • Loading branch information
Nicolas Pitre authored and nashif committed Jul 15, 2019
1 parent ab59209 commit 4ad2a8f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/libc/minimal/source/stdout/prf.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -737,6 +737,12 @@ int z_prf(int (*func)(), void *dest, const char *format, va_list vargs)
count++; count++;
break; break;


default:
PUTC('%');
PUTC(c);
count += 2;
break;

case 0: case 0:
return count; return count;
} }
Expand Down

0 comments on commit 4ad2a8f

Please sign in to comment.