diff options
author | Werner Koch <wk@gnupg.org> | 1998-08-11 19:29:34 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1998-08-11 19:29:34 +0200 |
commit | 3e0e8f884f1ed37e120beeb57aa7cd79e3c145a0 (patch) | |
tree | dfff62df60f917addc9df4e83a1ed73e31041bab /g10/comment.c | |
parent | rel 0.3.3 (diff) | |
download | gnupg2-3e0e8f884f1ed37e120beeb57aa7cd79e3c145a0.tar.xz gnupg2-3e0e8f884f1ed37e120beeb57aa7cd79e3c145a0.zip |
bug fix releaseV0-3-4
Diffstat (limited to 'g10/comment.c')
-rw-r--r-- | g10/comment.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/g10/comment.c b/g10/comment.c index fef831cc7..71d524c40 100644 --- a/g10/comment.c +++ b/g10/comment.c @@ -44,9 +44,17 @@ write_comment( IOBUF out, const char *s ) int rc=0; 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( *s != '#' ) { + pkt.pkt.comment = m_alloc( sizeof *pkt.pkt.comment + n ); + pkt.pkt.comment->len = n+1; + *pkt.pkt.comment->data = '#'; + strcpy(pkt.pkt.comment->data+1, s); + } + else { + 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 ); |