A simple solution would be to use unformatted output:
fwrite(x.data, 1, x.len, stdout);
This is a really bad form, since fwrite may not write everything, so it should be used in a loop;
for (size_t i, remaining = x.len; remaining > 0 && (i = fwrite(x.data, 1, remaining, stdout)) > 0; remaining -= i) { }
Make sure x.len not larger than SIZE_T_MAX .
source share