Fix readline as c++ string can contains a \0 char