diff options
-rw-r--r-- | AUTHORS | 2 | ||||
-rw-r--r-- | src/library.js | 2 | ||||
-rwxr-xr-x | tests/runner.py | 4 |
3 files changed, 5 insertions, 3 deletions
@@ -33,3 +33,5 @@ a license to everyone to use it as detailed in LICENSE.) * Justin Kerk <dopefishjustin@gmail.com> * Andrea Bedini <andrea.bedini@gmail.com> * James Pike <totoro.friend@chilon.net> +* Mokhtar Naamani <mokhtar.naamani@gmail.com> + diff --git a/src/library.js b/src/library.js index 0eefea84..4997d6e8 100644 --- a/src/library.js +++ b/src/library.js @@ -6295,7 +6295,7 @@ LibraryManager.library = { htonl: function(value) { return ((value & 0xff) << 24) + ((value & 0xff00) << 8) + - ((value & 0xff0000) >> 8) + ((value & 0xff000000) >> 24); + ((value & 0xff0000) >>> 8) + ((value & 0xff000000) >>> 24); }, htons: function(value) { return ((value & 0xff) << 8) + ((value & 0xff00) >> 8); diff --git a/tests/runner.py b/tests/runner.py index 54ae5a49..b569c416 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -5013,11 +5013,11 @@ def process(filename): #include <arpa/inet.h> int main() { - printf("*%x,%x,%x,%x*\n", htonl(0x12345678), htons(0xabcd), ntohl(0x43211234), ntohs(0xbeaf)); + printf("*%x,%x,%x,%x*\n", htonl(0xa1b2c3d4), htons(0xabcd), ntohl(0x43211234), ntohs(0xbeaf)); return 0; } ''' - self.do_run(src, '*78563412,cdab,34122143,afbe*') + self.do_run(src, '*d4c3b2a1,cdab,34122143,afbe*') def test_ctype(self): # The bit fiddling done by the macros using __ctype_b_loc requires this. |