fix getline by initialize len to 0