change readline() to read()
use read char by char