aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-09-05 09:52:26 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-09-05 09:52:26 -0700
commit793e9bbcc95331e7a55655e77cbad97024493cae (patch)
treec19a1aa030989132f26a1c1560ac2a2bb13c5322
parente9a8ed85db9f445a107e147493751feb477cfd5a (diff)
parent5849d6f1379f1d95e92520166691432ad3f23f89 (diff)
Merge pull request #557 from mnaamani/networking
fixed htonl
-rw-r--r--AUTHORS2
-rw-r--r--src/library.js2
-rwxr-xr-xtests/runner.py4
3 files changed, 5 insertions, 3 deletions
diff --git a/AUTHORS b/AUTHORS
index 849e2114..422380a3 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -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.