factor comparebuff
change perror to fprintf stderr
const input to compare_buff, string tests