g10/parse-packet.c: Replace literal with symbolic expression.

* g10/parse-packet.c (dump_hex_line): Use sizeof rather than the
buffer's size.

--
Signed-off-by: Neal H. Walfield <neal@g10code.com>.
This commit is contained in:
Neal H. Walfield 2015-08-19 13:38:20 +02:00
parent 026feff4a8
commit 24a72dffa7
1 changed files with 3 additions and 3 deletions

View File

@ -789,7 +789,7 @@ copy_packet (IOBUF inp, IOBUF out, int pkttype,
if (partial)
{
while ((n = iobuf_read (inp, buf, 100)) != -1)
while ((n = iobuf_read (inp, buf, sizeof (buf))) != -1)
if ((rc = iobuf_write (out, buf, n)))
return rc; /* write error */
}
@ -797,7 +797,7 @@ copy_packet (IOBUF inp, IOBUF out, int pkttype,
{
log_debug ("copy_packet: compressed!\n");
/* compressed packet, copy till EOF */
while ((n = iobuf_read (inp, buf, 100)) != -1)
while ((n = iobuf_read (inp, buf, sizeof (buf))) != -1)
if ((rc = iobuf_write (out, buf, n)))
return rc; /* write error */
}
@ -805,7 +805,7 @@ copy_packet (IOBUF inp, IOBUF out, int pkttype,
{
for (; pktlen; pktlen -= n)
{
n = pktlen > 100 ? 100 : pktlen;
n = pktlen > sizeof (buf) ? sizeof (buf) : pktlen;
n = iobuf_read (inp, buf, n);
if (n == -1)
return gpg_error (GPG_ERR_EOF);