update bytefreq.c and fix a Segfault bug