Implementing Huffman codec with C