]> git.sur5r.net Git - openldap/blobdiff - clients/ud/string_to_key.c
Fix format %x -> %lx in des_string_to_key
[openldap] / clients / ud / string_to_key.c
index 5e6f8a60f134f7e0709f16199a99dcf55ca5ed47..9160afba307b0f38eefb88505067f597b3e549ec 100644 (file)
@@ -3,7 +3,7 @@
 #if defined(HAVE_KERBEROS) && !defined(openbsd)
 /*
  * $Source: /repo/OpenLDAP/pkg/ldap/clients/ud/string_to_key.c,v $
- * $Author: hallvard $
+ * $Author: kdz $
  *
  * Copyright 1985, 1986, 1987, 1988, 1989 by the Massachusetts Institute
  * of Technology.
 #include <stdio.h>
 #include <ac/krb.h>
 
+#if defined( DEBUG ) && defined( HAVE_DES_DEBUG )
+#define USE_DES_DEBUG
 extern int des_debug;
-extern int des_debug_print();
+#endif
+
 extern void des_fixup_key_parity();
 
 #ifndef HAVE_AFS_KERBEROS
@@ -64,7 +67,7 @@ des_string_to_key( char *str, register des_cblock *key )
     /* init key array for bits */
     memset(k_char, 0, sizeof(k_char));
 
-#ifdef DEBUG
+#ifdef USE_DES_DEBUG
     if (des_debug)
        fprintf(stdout,
                "\n\ninput str length = %d  string = %s\nstring = 0x ",
@@ -75,7 +78,7 @@ des_string_to_key( char *str, register des_cblock *key )
     for (i = 1; i <= length; i++) {
        /* get next input key byte */
        temp = (unsigned int) *str++;
-#ifdef DEBUG
+#ifdef USE_DES_DEBUG
        if (des_debug)
            fprintf(stdout,"%02x ",temp & 0xff);
 #endif
@@ -116,11 +119,13 @@ des_string_to_key( char *str, register des_cblock *key )
     /* now fix up key parity again */
     des_fixup_key_parity(key);
 
+#ifdef USE_DES_DEBUG
     if (des_debug)
        fprintf(stdout,
-               "\nResulting string_to_key = 0x%x 0x%x\n",
+               "\nResulting string_to_key = 0x%lx 0x%lx\n",
                *((unsigned long *) key),
                *((unsigned long *) key+1));
+#endif
 }
 
 #endif /* HAVE_KERBEROS_V */