Make sure log string is null-terminated.