Closed Bug 27834 Opened 25 years ago Closed 25 years ago

PR_ntohll and PR_htonll dumbly swap bytes.

Categories

(NSPR :: NSPR, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wtc, Assigned: wtc)

Details

Attachments

(1 file)

This bug is reported by Doug Turner (dougt@netscape.com)
in netscape.public.mozilla.nspr:
    Currently they are dumbly swapping.  could these check
    to see if the bytes to need to be rearranged and if
    they do not, just no-op?
Status: NEW → ASSIGNED
I added a new test nsprpub/pr/tests/ntoh.c for
PR_ntohs, PR_ntohl, PR_ntohll, PR_htons, PR_htonl,
and PR_htonll on the NSPRPUB_RELEASE_4_0_BRANCH.
Turns out that PR_htonll and PR_ntohll not only
dumbly swap bytes but also swap bytes incorrectly.
The 'lo' and 'hi' halves should also be swapped.
I checked in the fix on NSPRPUB_RELEASE_4_0_BRANCH.
/cvsroot/mozilla/nsprpub/pr/src/misc/prnetdb.c, revision 3.11.4.16
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: