]> git.sur5r.net Git - openldap/blobdiff - clients/ud/edit.c
Fix format %x -> %lx in des_string_to_key
[openldap] / clients / ud / edit.c
index b34790ca92f4d64ad7e0a0cad28951084d6b7fea..3cc1530d9bdebc507f90bba09d27036f834d8662 100644 (file)
@@ -13,7 +13,8 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <stdlib.h>
+
+#include <ac/stdlib.h>
 
 #include <ac/signal.h>
 #include <ac/string.h>
@@ -31,7 +32,7 @@
 
 #include <lber.h>
 #include <ldap.h>
-#include <ldapconfig.h>
+#include <ldap_defaults.h>
 #include "ud.h"
 
 static int  load_editor( void );
@@ -93,7 +94,7 @@ edit( char *who )
        }
        dn = ldap_get_dn(ld, ldap_first_entry(ld, mp));
        rdns = ldap_explode_dn(dn, TRUE);
-       Free(dn);
+       ldap_memfree(dn);
        if (verbose) {
                printf("\n  Editing directory entry \"%s\"...\n", *rdns);
        }
@@ -114,10 +115,11 @@ load_editor( void )
        FILE *fp;
        char *cp, *editor = UD_DEFAULT_EDITOR;
        static char template[MED_BUF_SIZE];
+#ifndef HAVE_SPAWNLP
        int pid;
        int status;
+#endif
        int rc;
-       void (*handler)();
        
 #ifdef DEBUG
        if (debug & D_TRACE)
@@ -186,6 +188,7 @@ load_editor( void )
        }
        else if (pid > 0) {
                /* parent - wait until the child proc is done editing */
+               RETSIGTYPE (*handler)();
                handler = SIGNAL(SIGINT, SIG_IGN);
                (void) wait(&status);
                (void) SIGNAL(SIGINT, handler);
@@ -204,8 +207,12 @@ print_attrs_and_values( FILE *fp, struct attribute *attrs, short int flag )
        register int i, j;
 
        for (i = 0; attrs[i].quipu_name != NULL; i++) {
-               if (!modifiable(attrs[i].quipu_name, flag|ATTR_FLAG_MAY_EDIT))
+               if (!modifiable(attrs[i].quipu_name,
+                       (short) (flag|ATTR_FLAG_MAY_EDIT)))
+               {
                        continue;
+               }
+
                fprintf(fp, "%s\n", attrs[i].quipu_name);
                if ( attrs[i].number_of_values > MAX_VALUES ) {
                        printf("  The %s attribute has more than %d values.\n",
@@ -259,8 +266,8 @@ write_entry( void )
                cp = line;
                if (*cp == '#')
                        continue;
-               if (isspace(*cp)) {     /* value */
-                       while (isspace(*cp))
+               if (isspace((unsigned char)*cp)) {      /* value */
+                       while (isspace((unsigned char)*cp))
                                cp++;
                        values[number_of_values++] = strdup(cp);
                        if ( number_of_values >= MAX_VALUES ) {
@@ -270,7 +277,7 @@ write_entry( void )
                        continue;
                }
                /* attribute */
-               while (isspace(*cp))
+               while (isspace((unsigned char)*cp))
                        cp++;
                /*
                 *  If the number of values is greater than zero, then we