Files
RedBear-OS/tests/printf.c
T
Alex Lyon 0cabecd5b5 stdio, string, platform: fix a bug in printf() involving chars
Because we were previously converting the bytes in the format
string into Rust's char type and then printing that using the
format machinery, byte values that were not valid single-byte
UTF-8 characters failed to print correctly.  I found this while
trying to implement qsort() because the output of my test program
was mysteriously incorrect despite it working when I used glibc.
2018-05-11 23:09:12 -07:00

17 lines
313 B
C

#include <stdio.h>
int main(int argc, char ** argv) {
printf(
"percent: %%\nstring: %s\nchar: %c\nchar: %c\nint: %d\nuint: %u\nhex: %x\nHEX: %X\nstring: %s\n",
"String",
'c',
254,
-16,
32,
0xbeef,
0xC0FFEE,
"end"
);
return 0;
}