Maybe icarus_gets should return actual bytes read?