Fix assignment of null terminator