Bug 958444: Fix address setup in NFC connector, r=allstars.chh

The use of htons on the network address truncates its value. Using
htonl instead fixes this problem. The change also makes Nfc.cpp
build without warnings.
This commit is contained in:
Thomas Zimmermann 2014-01-10 12:40:51 +01:00
parent 3ac86a587f
commit 5e403292c5

View File

@ -241,7 +241,7 @@ NfcConnector::CreateAddr(bool aIsServer,
case AF_INET:
aAddr.in.sin_family = af;
aAddr.in.sin_port = htons(NFC_TEST_PORT);
aAddr.in.sin_addr.s_addr = htons(INADDR_LOOPBACK);
aAddr.in.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
aAddrSize = sizeof(sockaddr_in);
break;
default: