previously we would always read 21 bytes even if the given string ended earlier with a '\0' character