diff options
Diffstat (limited to 'g10/encode.c')
-rw-r--r-- | g10/encode.c | 59 |
1 files changed, 1 insertions, 58 deletions
diff --git a/g10/encode.c b/g10/encode.c index 272462d47..9ef2c1099 100644 --- a/g10/encode.c +++ b/g10/encode.c @@ -1,4 +1,4 @@ -/* encode.c - encode/sign data +/* encode.c - encode data * Copyright (c) 1997 by Werner Koch (dd9jn) * * This file is part of G10. @@ -39,7 +39,6 @@ static int encode_simple( const char *filename, int mode ); -static IOBUF open_outfile( const char *iname ); /**************** @@ -62,22 +61,6 @@ encode_store( const char *filename ) return encode_simple( filename, 0 ); } -static void -write_comment( IOBUF out, const char *s ) -{ - PACKET pkt; - size_t n = strlen(s); - int rc; - - pkt.pkttype = PKT_COMMENT; - pkt.pkt.comment = m_alloc( sizeof *pkt.pkt.comment + n - 1 ); - pkt.pkt.comment->len = n; - strcpy(pkt.pkt.comment->data, s); - if( (rc = build_packet( out, &pkt )) ) - log_error("build_packet(comment) failed: %s\n", g10_errstr(rc) ); - free_packet( &pkt ); -} - static int encode_simple( const char *filename, int mode ) @@ -335,44 +318,4 @@ encode_crypt( const char *filename, STRLIST remusr ) } -/**************** - * Make an output filename for the inputfile INAME. - * Returns an - */ -static IOBUF -open_outfile( const char *iname ) -{ - IOBUF a = NULL; - int rc; - - if( (!iname && !opt.outfile) || opt.outfile_is_stdout ) { - if( !(a = iobuf_create(NULL)) ) - log_error("can't open [stdout]: %s\n", strerror(errno) ); - else if( opt.verbose ) - log_info("writing to stdout\n"); - } - else { - char *buf=NULL; - const char *name; - - if( opt.outfile ) - name = opt.outfile; - else { - buf = m_alloc(strlen(iname)+4+1); - strcpy(stpcpy(buf,iname), ".g10"); - name = buf; - } - if( !(rc=overwrite_filep( name )) ) { - if( !(a = iobuf_create( name )) ) - log_error("can't create %s: %s\n", name, strerror(errno) ); - else if( opt.verbose ) - log_info("writing to '%s'\n", name ); - } - else if( rc != -1 ) - log_error("oops: overwrite_filep(%s): %s\n", name, g10_errstr(rc) ); - m_free(buf); - } - return a; -} - |