Actions
Bug #13315
closedSingle "%" at the end of `printf` format string appears in the result
Bug #13315:
Single "%" at the end of `printf` format string appears in the result
Description
Is this intentional?
printf("%") #=> "%"
printf
in glibc does print nothing, gcc warns though.
#include <stdio.h>
int main(void)
{
printf("%");
return 0;
}
$ gcc fmt.c && ./a.out
fmt.c: In function ‘main’:
fmt.c:5:10: warning: spurious trailing ‘%’ in format [-Wformat=]
printf("%");
^
printf
command of bash errs.
$ printf "%"
-bash: printf: `%': missing format character
Actions