Make the char buffers explicitly unsigned.
Remove the alignment-icky casting.

Instead decode the size directly from the buffer start.

(pointed out by clang -Wcast-align, which works in x86
 as opposed to gcc -Wcast-align, for hysterical reasons)