mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-31 11:41:32 +01:00
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:
parent
026feff4a8
commit
24a72dffa7
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user