Skip to content

Commit

Permalink
Storable.xs: Fix a (possible) typo in byte-masking expression.
Browse files Browse the repository at this point in the history
The containing function (Sntohl) seems to be never compiled because
<perl.h> always defines HAS_NTOHL, so no visible change is expected.
  • Loading branch information
t-a-k authored and khwilliamson committed Aug 12, 2021
1 parent 8d469d0 commit 3e05d64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dist/Storable/Storable.xs
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,7 @@ static const char byteorderstr_56[] = {BYTEORDER_BYTES_56, 0};
# define Sntohl(x) (x)
# else
static U32 Sntohl(U32 x) {
return (((U8) x) << 24) + ((x * 0xFF00) << 8)
return (((U8) x) << 24) + ((x & 0xFF00) << 8)
+ ((x & 0xFF0000) >> 8) + ((x & 0xFF000000) >> 24);
}
# endif
Expand Down

0 comments on commit 3e05d64

Please sign in to comment.