The first element of the charset
array is 0x00
, which is the string terminator, telling printf
to stop there -- without printing anything. Replace printf
with:
fwrite(charset, sizeof (charset), 1, stdout);
which allows you specify the lenght of the array being printed explicitly.