From b33cbf5e4b8386f89f813a1b2886b9c32ae479ff Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sun, 23 Sep 2012 23:17:00 +0200 Subject: [PATCH] simplified calculations --- lib/opencdk/write-packet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/opencdk/write-packet.c b/lib/opencdk/write-packet.c index 7a53e84d7..521728fd4 100644 --- a/lib/opencdk/write-packet.c +++ b/lib/opencdk/write-packet.c @@ -159,9 +159,9 @@ pkt_encode_len (cdk_stream_t out, size_t pktlen) else if (pktlen < 8384) { pktlen -= 192; - rc = stream_putc (out, (pktlen / 256) + 192); + rc = stream_putc (out, (pktlen >> 8) + 192); if (!rc) - rc = stream_putc (out, (pktlen % 256)); + rc = stream_putc (out, (pktlen & 0xff)); } else { -- 2.11.4.GIT