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

fix the way endianness is detected #24

Merged
merged 2 commits into from May 5, 2014
Merged

Conversation

edwardrf
Copy link
Contributor

@edwardrf edwardrf commented May 5, 2014

I believe the code used to detect endianness is similar to this thread: http://lua-users.org/lists/lua-l/2008-11/msg00075.html.

However, the current code fails to detect the correct endianness on openWRT system on a MIPS cpu (which is big endian)

@ToxicFrog
Copy link
Owner

What does the extra argument to string.dump() do? It's not documented anywhere and on lua 5.2/linux it doesn't seem to have any effect.

@edwardrf
Copy link
Contributor Author

edwardrf commented May 5, 2014

sorry, i had the position of the bracket wrong. It is fixed now, the argurment is to the string.byte function, not to dump.

@ToxicFrog
Copy link
Owner

That makes more sense :)

Re-reading the binary chunk spec, it looks like this has always been broken; I just don't have any big-endian machines to test it on, so I never noticed.

ToxicFrog added a commit that referenced this pull request May 5, 2014
Fix endianness detection by checking the actual endianness flag rather than part of the magic number.
@ToxicFrog ToxicFrog merged commit 20c36cc into ToxicFrog:master May 5, 2014
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

Successfully merging this pull request may close these issues.

None yet

2 participants