From 9b511d8943fa34c9dd09999a4a72ae8405f34164 Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Mon, 31 May 2004 23:47:09 +0000 Subject: [PATCH] cscvs to tla changeset 30 Author: noodles Date: 2002/11/13 19:25:44 Fix off by one bug in armor routine (we'd print NULLs in the header/footer). --- armor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/armor.c b/armor.c index 9f5c19a..343f9d6 100644 --- a/armor.c +++ b/armor.c @@ -303,9 +303,9 @@ int armor_openpgp_stream(int (*putchar_func)(void *ctx, size_t count, /* * Print armor header */ - putchar_func(ctx, sizeof("-----BEGIN PGP PUBLIC KEY BLOCK-----\n"), + putchar_func(ctx, sizeof("-----BEGIN PGP PUBLIC KEY BLOCK-----\n") - 1, (unsigned char *) "-----BEGIN PGP PUBLIC KEY BLOCK-----\n"); - putchar_func(ctx, sizeof("Version: onak " VERSION "\n\n"), + putchar_func(ctx, sizeof("Version: onak " VERSION "\n\n") - 1, (unsigned char *) "Version: onak " VERSION "\n\n"); armor_init(&armor_ctx); @@ -317,7 +317,7 @@ int armor_openpgp_stream(int (*putchar_func)(void *ctx, size_t count, /* * Print armor footer */ - putchar_func(ctx, sizeof("-----END PGP PUBLIC KEY BLOCK-----\n"), + putchar_func(ctx, sizeof("-----END PGP PUBLIC KEY BLOCK-----\n") - 1, (unsigned char *) "-----END PGP PUBLIC KEY BLOCK-----\n"); return 0; -- 2.30.2