fixed buf_putc()