Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested improvement #1

Closed
MikhailMartianov opened this issue Apr 11, 2024 · 1 comment
Closed

Suggested improvement #1

MikhailMartianov opened this issue Apr 11, 2024 · 1 comment

Comments

@MikhailMartianov
Copy link

While exploring your beautiful library, I noticed a minor inaccuracy in the code that may affect the outcome of compilation.
I propose a fix for the WriteBigEndian method, replacing the variable "out" with "buf"

template <typename T> inline void WriteBigEndian(char* buf, T val) { memcpy(out, static_cast<const T*>(&val), sizeof(T)); }

Corrected version:
template <typename T> inline void WriteBigEndian(char* buf, T val) { memcpy(buf, static_cast<const T*>(&val), sizeof(T)); }

@chokobole
Copy link
Owner

@MikhailMartianov Yes you're right! Thanks to let me know this! It was built a very long time ago and hasn't been maintained long..!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants