diff options
author | Werner Koch <wk@gnupg.org> | 1998-10-25 20:00:01 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1998-10-25 20:00:01 +0100 |
commit | 5ccb92591e5ff9cf90efeb5ef527cf7a5fb08fcf (patch) | |
tree | 241529d030ede38fcdaee1a708c5956693ed159d /g10/encode.c | |
parent | Epxerimenta support for GDBM keyings. (diff) | |
download | gnupg2-5ccb92591e5ff9cf90efeb5ef527cf7a5fb08fcf.tar.xz gnupg2-5ccb92591e5ff9cf90efeb5ef527cf7a5fb08fcf.zip |
some random changes
Diffstat (limited to 'g10/encode.c')
-rw-r--r-- | g10/encode.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/g10/encode.c b/g10/encode.c index 0d8a84c94..371a23731 100644 --- a/g10/encode.c +++ b/g10/encode.c @@ -140,10 +140,11 @@ encode_simple( const char *filename, int mode ) /* setup the inner packet */ if( filename || opt.set_filename ) { - const char *s = opt.set_filename ? opt.set_filename : filename; + char *s = make_basename( opt.set_filename ? opt.set_filename : filename ); pt = m_alloc( sizeof *pt + strlen(s) - 1 ); pt->namelen = strlen(s); memcpy(pt->name, s, pt->namelen ); + m_free(s); } else { /* no filename */ pt = m_alloc( sizeof *pt - 1 ); @@ -253,10 +254,11 @@ encode_crypt( const char *filename, STRLIST remusr ) /* setup the inner packet */ if( filename || opt.set_filename ) { - const char *s = opt.set_filename ? opt.set_filename : filename; + char *s = make_basename( opt.set_filename ? opt.set_filename : filename ); pt = m_alloc( sizeof *pt + strlen(s) - 1 ); pt->namelen = strlen(s); memcpy(pt->name, s, pt->namelen ); + m_free(s); } else { /* no filename */ pt = m_alloc( sizeof *pt - 1 ); |