Fix an off-by-one error when retrieving the hostname
Fix an off-by-one error when retrieving the hostname

Issue found by Markus Rudy

PiperOrigin-RevId: 371894310

google/glome,google/glome,google/glome,google/glome,google/glome