aboutsummaryrefslogtreecommitdiffstats
path: root/g10/armor.c
diff options
context:
space:
mode:
authorNeal H. Walfield <[email protected]>2016-11-29 13:41:22 +0000
committerNeal H. Walfield <[email protected]>2016-11-29 13:56:00 +0000
commit522f74f7e377135cf098b6b0b9b35284c1dfc963 (patch)
treea5efc5605817ff6473b2149c016343716d0c00ed /g10/armor.c
parentg10: Extend TOFU_STATS to always show the validity (diff)
downloadgnupg-522f74f7e377135cf098b6b0b9b35284c1dfc963.tar.gz
gnupg-522f74f7e377135cf098b6b0b9b35284c1dfc963.zip
Improve some comments.
Diffstat (limited to '')
-rw-r--r--g10/armor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/g10/armor.c b/g10/armor.c
index c80e902d2..58d8e01b1 100644
--- a/g10/armor.c
+++ b/g10/armor.c
@@ -1026,17 +1026,20 @@ armor_filter( void *opaque, int control,
if( control == IOBUFCTRL_UNDERFLOW && afx->inp_bypass ) {
n = 0;
if( afx->buffer_len ) {
+ /* Copy the data from AFX->BUFFER to BUF. */
for(; n < size && afx->buffer_pos < afx->buffer_len; n++ )
buf[n++] = afx->buffer[afx->buffer_pos++];
if( afx->buffer_pos >= afx->buffer_len )
afx->buffer_len = 0;
}
+ /* If there is still space in BUF, read directly into it. */
for(; n < size; n++ ) {
if( (c=iobuf_get(a)) == -1 )
break;
buf[n] = c & 0xff;
}
if( !n )
+ /* We didn't get any data. EOF. */
rc = -1;
*ret_len = n;
}