summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2014-10-12 19:15:20 +0200
committerWerner Koch <wk@gnupg.org>2014-10-12 19:16:13 +0200
commit2d68dc437e7de92619abe3a019b0a7606487b6bf (patch)
treeeab7469e5d1c80df3350a0f3918ed9760cf3e810
parentUse a unique capitalization for "Note:". (diff)
downloadgnupg2-2d68dc437e7de92619abe3a019b0a7606487b6bf.tar.xz
gnupg2-2d68dc437e7de92619abe3a019b0a7606487b6bf.zip
gpg: Minor change for better readability.
* g10/build-packet.c (write_version): Remove. (do_pubkey_enc, do_onepass_sig): Write version directly. Signed-off-by: Werner Koch <wk@gnupg.org>
-rw-r--r--g10/build-packet.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/g10/build-packet.c b/g10/build-packet.c
index 7464979cf..af0de3b41 100644
--- a/g10/build-packet.c
+++ b/g10/build-packet.c
@@ -52,7 +52,6 @@ static int write_header( IOBUF out, int ctb, u32 len );
static int write_sign_packet_header( IOBUF out, int ctb, u32 len );
static int write_header2( IOBUF out, int ctb, u32 len, int hdrlen );
static int write_new_header( IOBUF out, int ctb, u32 len, int hdrlen );
-static int write_version( IOBUF out, int ctb );
/****************
* Build a packet and write it to INP
@@ -488,7 +487,8 @@ do_pubkey_enc( IOBUF out, int ctb, PKT_pubkey_enc *enc )
int n, i;
IOBUF a = iobuf_temp();
- write_version( a, ctb );
+ iobuf_put (a, 3); /* Version. */
+
if ( enc->throw_keyid )
{
write_32(a, 0 ); /* Don't tell Eve who can decrypt the message. */
@@ -1190,7 +1190,7 @@ do_onepass_sig( IOBUF out, int ctb, PKT_onepass_sig *ops )
int rc = 0;
IOBUF a = iobuf_temp();
- write_version( a, ctb );
+ iobuf_put (a, 3); /* Version. */
iobuf_put(a, ops->sig_class );
iobuf_put(a, ops->digest_algo );
iobuf_put(a, ops->pubkey_algo );
@@ -1370,13 +1370,3 @@ write_new_header( IOBUF out, int ctb, u32 len, int hdrlen )
}
return 0;
}
-
-static int
-write_version (IOBUF out, int ctb)
-{
- (void)ctb;
-
- if (iobuf_put (out, 3))
- return -1;
- return 0;
-}