diff options
author | Neal H. Walfield <[email protected]> | 2015-08-19 11:38:20 +0000 |
---|---|---|
committer | Neal H. Walfield <[email protected]> | 2015-08-20 12:16:30 +0000 |
commit | 24a72dffa75a04611c98343140c4eb0fbfe2a59f (patch) | |
tree | edae9738cc9e9f1af4eb9d397f3e44396c7de4b6 | |
parent | Add documentation for g10/parse-packet.c. (diff) | |
download | gnupg-24a72dffa75a04611c98343140c4eb0fbfe2a59f.tar.gz gnupg-24a72dffa75a04611c98343140c4eb0fbfe2a59f.zip |
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 <[email protected]>.
-rw-r--r-- | g10/parse-packet.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/g10/parse-packet.c b/g10/parse-packet.c index fe11a870f..1335403c0 100644 --- a/g10/parse-packet.c +++ b/g10/parse-packet.c @@ -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); |