readstring stuff and fix \0 in get token