I pushed a memset as well in the charsel-gen code..but, that likely won't help your case.
Let me look over what you have in this encode.
I'm assuming that you're still using the Ti-based character select struct? (pre-variable toons per client version)
EDIT: Your
Code:
memcpy(eq2->name, emu->name[r], strlen(emu->name[r]) + 1);
essentially does the same thing as the Name[0] = '\0' - assuming that the server gen code has a proper nullterm.
Still looking over it..I'm not seeing an immediate problem..but, might need to compare the structs to make sure something isn't off there.
EDIT2: Does your UF::structs::CharacterSelectEntry_Struct have its name field declared as char name[1] or char name[0]?
EDIT3: Ok, just did a diff of crash/no crash hex dumps after adding in the 'ppy' to the crash one - there was no difference.
The packet structure appears to be properly filled in the crash version and I'm just not seeing anything in the encode function that would cause this.
Have you tried running it without the scope declarations? I'm wondering if the wrong struct isn't being referenced for size...