m6w6 / ext-http

Extended HTTP Support
BSD 2-Clause "Simplified" License
79 stars 22 forks source link

Use ntohl instead of doing LE conversion yourself #60

Closed oerdnj closed 7 years ago

oerdnj commented 7 years ago

Instead of using own endianess conversion code, just use ntohl() which is exactly the thing you want.

This variant uses alignment safe code, but if you are sure, this will be always aligned, the memcpy() part can be safely dropped.

In case this might not be aligned, even the original code might be wrong on some architectures (the (uint *) conversion).

m6w6 commented 7 years ago

Thanks a lot!