There is no need to remove the null terminator, substr does not consider a
part of the actual string.