1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

a couple of changes; but some parts are now broken

This commit is contained in:
Werner Koch 1998-02-11 03:25:44 +00:00
parent d6fa02add6
commit 4c0c155922
46 changed files with 1879 additions and 433 deletions

View file

@ -313,7 +313,7 @@ iobuf_close( IOBUF a )
size_t dummy_len;
int rc=0;
for( ; a; a = a2 ) {
for( ; a && !rc ; a = a2 ) {
a2 = a->chain;
if( a->usage == 2 && (rc=iobuf_flush(a)) )
log_error("iobuf_flush failed on close: %s\n", g10_errstr(rc));
@ -723,6 +723,26 @@ iobuf_readbyte(IOBUF a)
}
int
iobuf_read(IOBUF a, byte *buf, unsigned buflen )
{
int c, n;
for(n=0 ; n < buflen; n++, buf++ ) {
if( (c = iobuf_readbyte(a)) == -1 ) {
if( !n )
return -1; /* eof */
break;
}
else
*buf = c;
}
return n;
}
int
iobuf_writebyte(IOBUF a, unsigned c)
{