Removed strcpy calls as those would lead to a buffer overflow and were unnecessary. Alse added nullptr checking just in case (official Google effects do so)