parse null-terminated strings