]> git.sur5r.net Git - openldap/blobdiff - clients/fax500/main.c
Provide a little information about SDF, how to use it, and where to get it.h
[openldap] / clients / fax500 / main.c
index cf5fb5e7fd07cfbaffaf116a6562e31810c3dc7c..5cd49dbf812eb6deb4663253c21cf06842c99163 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 
+#include <ac/ctype.h>
+#include <ac/errno.h>
+#include <ac/signal.h>
 #include <ac/socket.h>
 #include <ac/string.h>
+#include <ac/sysexits.h>
 #include <ac/syslog.h>
 #include <ac/time.h>
-#include <ac/wait.h>
 #include <ac/unistd.h>
-#include <ac/errno.h>
+#include <ac/wait.h>
 
 #ifdef HAVE_SYS_PARAM_H
 #include <sys/param.h>
@@ -30,8 +33,6 @@
 #include <sys/resource.h>
 #endif
 
-#include <sysexits.h>
-
 #include "lber.h"
 #include "ldap.h"
 
@@ -184,6 +185,10 @@ main ( int argc, char **argv )
                identity = MAIL500;
        }
 
+#ifdef SIGPIPE
+       (void) SIGNAL( SIGPIPE, SIG_IGN );
+#endif
+
 #ifdef LOG_MAIL
        openlog( myname, OPENLOG_OPTIONS, LOG_MAIL );
 #else
@@ -1142,7 +1147,7 @@ do_noemailorfax( FILE *fp, Error *err, int namelen, int errtype )
                    != NULL ) {
                        for ( i = 0; vals[i]; i++ ) {
                                last = strlen( vals[i] ) - 1;
-                               if ( isdigit( vals[i][last] ) ) {
+                               if ( isdigit((unsigned char) vals[i][last]) ) {
                                        rdn = strdup( vals[i] );
                                        break;
                                }
@@ -1180,7 +1185,7 @@ do_noemailorfax( FILE *fp, Error *err, int namelen, int errtype )
                for ( i = 0; vals[0][i] != '\0'; i++ ) {
                        if ( vals[0][i] == '$' ) {
                                fprintf( fp, "\n%*s  ", namelen, " " );
-                               while ( isspace( vals[0][i+1] ) )
+                               while ( isspace((unsigned char) vals[0][i+1]) )
                                        i++;
                        } else {
                                fprintf( fp, "%c", vals[0][i] );
@@ -1229,7 +1234,7 @@ do_ambiguous( FILE *fp, Error *err, int namelen )
                        if ( (vals = ldap_get_values( ld, e, "cn" )) != NULL ) {
                                for ( i = 0; vals[i]; i++ ) {
                                        last = strlen( vals[i] ) - 1;
-                                       if ( isdigit( vals[i][last] ) ) {
+                                       if ( isdigit((unsigned char) vals[i][last]) ) {
                                                rdn = strdup( vals[i] );
                                                break;
                                        }