summaryrefslogtreecommitdiff
path: root/configpm
diff options
context:
space:
mode:
Diffstat (limited to 'configpm')
-rwxr-xr-xconfigpm7
1 files changed, 3 insertions, 4 deletions
diff --git a/configpm b/configpm
index bea9ef5d44..33811eec27 100755
--- a/configpm
+++ b/configpm
@@ -412,13 +412,12 @@ my $f = $t eq 'long' ? 'L!' : $s == 8 ? 'Q': 'I';
my $byteorder_code;
if ($s == 4 || $s == 8) {
- my $list = join ',', reverse(2..$s);
+ my $list = join ',', reverse(1..$s-1);
my $format = 'a'x$s;
$byteorder_code = <<"EOT";
-my \$i = 0;
-foreach my \$c ($list) { \$i |= ord(\$c); \$i <<= 8 }
-\$i |= ord(1);
+my \$i = ord($s);
+foreach my \$c ($list) { \$i <<= 8; \$i |= ord(\$c); }
our \$byteorder = join('', unpack('$format', pack('$f', \$i)));
EOT
} else {