]> git.sommitrealweird.co.uk Git - onak.git/commitdiff
cscvs to tla changeset 30
authorJonathan McDowell <noodles@earth.li>
Mon, 31 May 2004 23:47:09 +0000 (23:47 +0000)
committerJonathan McDowell <noodles@earth.li>
Mon, 31 May 2004 23:47:09 +0000 (23:47 +0000)
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

diff --git a/armor.c b/armor.c
index 9f5c19a32eeadac1d40fc84bced2d55c49ca7c12..343f9d6779bb6ab81d58f832c49161edccce672a 100644 (file)
--- 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
         */
        /*
         * 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");
                (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);
                (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
         */
        /*
         * 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;
                (unsigned char *) "-----END PGP PUBLIC KEY BLOCK-----\n");
 
        return 0;