diff options
Diffstat (limited to '')
-rw-r--r-- | g10/comment.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/g10/comment.c b/g10/comment.c index ab5d2941e..b52104cd7 100644 --- a/g10/comment.c +++ b/g10/comment.c @@ -63,19 +63,24 @@ write_comment( iobuf_t out, const char *s ) KBNODE -make_comment_node( const char *s ) +make_comment_node_from_buffer (const char *s, size_t n) { PACKET *pkt; - size_t n = strlen(s); - pkt = xcalloc (1, sizeof *pkt ); + pkt = gcry_xcalloc( 1, sizeof *pkt ); pkt->pkttype = PKT_COMMENT; - pkt->pkt.comment = xmalloc ( sizeof *pkt->pkt.comment + n - 1 ); + pkt->pkt.comment = gcry_xmalloc( sizeof *pkt->pkt.comment + n - 1 ); pkt->pkt.comment->len = n; strcpy(pkt->pkt.comment->data, s); return new_kbnode( pkt ); } +KBNODE +make_comment_node( const char *s ) +{ + return make_comment_node_from_buffer (s, strlen (s)); +} + KBNODE make_mpi_comment_node( const char *s, gcry_mpi_t a ) |