Changed type of buff character to int, to avoid conversion from getc()'s returned value.