From: Jonathan McDowell Date: Mon, 31 May 2004 23:47:09 +0000 (+0000) Subject: cscvs to tla changeset 30 X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/commitdiff_plain/9b511d8943fa34c9dd09999a4a72ae8405f34164 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). --- 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;