Only seed database for Debian install if we're using default config
[onak.git] / armor.c
diff --git a/armor.c b/armor.c
index ac1d23f44d1696ede71258dafde24f6b4086061d..bb0085e348d3b73846367b7bab80938e0cc75f21 100644 (file)
--- a/armor.c
+++ b/armor.c
@@ -6,11 +6,12 @@
  * Copyright 2002 Project Purple
  */
 
-#include <assert.h>
 #include <stdlib.h>
 
 #include "armor.h"
+#include "config.h"
 #include "keystructs.h"
+#include "log.h"
 #include "onak-conf.h"
 #include "parsekey.h"
 
@@ -34,7 +35,7 @@ static unsigned char encode64(unsigned char c) {
        } else if (c == 63) {
                c = '/';
        } else {
-               assert(c < 64);
+               log_assert(c < 64);
        }
 
        return c;
@@ -142,7 +143,7 @@ static int armor_putchar_int(void *ctx, unsigned char c)
        unsigned char t;
        int i;
 
-       assert(ctx != NULL);
+       log_assert(ctx != NULL);
        state = (struct armor_context *) ctx;
 
        switch (state->curoctet++) {
@@ -187,6 +188,8 @@ static int armor_putchar(void *ctx, size_t count, unsigned char *c)
 {
        int i;
 
+       log_assert(c != NULL);
+
        for (i = 0; i < count; i++) {
                armor_putchar_int(ctx, c[i]);
        }
@@ -243,7 +246,7 @@ static int dearmor_getchar(void *ctx, unsigned char *c)
        unsigned char tmpc;
        int i;
 
-       assert(ctx != NULL);
+       log_assert(ctx != NULL);
        state = (struct dearmor_context *) ctx;
        *c = 0;
        
@@ -320,8 +323,8 @@ int armor_openpgp_stream(int (*putchar_func)(void *ctx, size_t count,
         */
        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") - 1,
-               (unsigned char *) "Version: onak " VERSION "\n\n");
+       putchar_func(ctx, sizeof("Version: onak " PACKAGE_VERSION "\n\n") - 1,
+               (unsigned char *) "Version: onak " PACKAGE_VERSION "\n\n");
        
        armor_init(&armor_ctx);
        armor_ctx.putchar_func = putchar_func;