The checksum needs to be a 16bit value, so we pack, then unpack the
checksum total in debug_split_print to guarantee that. Some longer
messages have generated 32-bit checksums.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
printf STDERR "= %4d\n\n", $subtotal;
}
printf STDERR "%56d\n", $total;
- return $total;
+ # Pack, then upack to make sure we have 16-bit value.
+ return unpack("S", pack("S", $total));
}