Closed cher-nov closed 4 months ago
Fixed.
Excuse me if my proposal offended you in any way, I didn't mean to.
Fixed.
May I ask, please, why are you checking packet->dataLength
for 0 in your version of the patch? Calling the memcpy()
function simply turns into a NOP in this case (if both pointers are valid), doesn’t it?
https://github.com/lsalzman/enet/blob/0b924c79ceb7b3c46d82dd00f6f1ed3f664d02d0/packet.c#L92-L98
https://en.cppreference.com/w/cpp/string/byte/memcpy
https://en.cppreference.com/w/c/string/byte/memcpy
I've also noticed a lot of trailing whitespace and odd (3-spaced) indentation in the current library code. Would you be interested in a pull request that fixes this?