]> git.sur5r.net Git - openldap/commitdiff
Fix misc syntax warnings and/or bugs.
authorHoward Chu <hyc@openldap.org>
Thu, 28 Oct 1999 07:18:48 +0000 (07:18 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 28 Oct 1999 07:18:48 +0000 (07:18 +0000)
See README 1.27 log

clients/ud/group.c
libraries/liblutil/getopt.c
libraries/liblutil/ntservice.c

index 950631d765073030efd897418b09cc4472cdbbc0..98936c7886cc95563871dc80275224350565385d 100644 (file)
@@ -239,10 +239,12 @@ remove_group( char *name )
        }
        ldap_uncache_entry(ld, dn);
        if (verbose)
+       {
            if (name == NULL)
                printf("  The group has been removed.\n");
            else
                printf("  The group \"%s\" has been removed.\n", name);
+       }
        Free(dn);
        return;
 }
index 3b0ca476a5b59a55099101733c5eb95d4a854d4a..ac63dbdae4d9240ae647c24dada2f542cc7342a1 100644 (file)
@@ -59,6 +59,7 @@ int getopt (int argc, char * const argv [], const char * opts)
 printf("DF_TRACE_DEBUG:        int getopt () in getopt.c\n");
 #endif
        if (sp == 1)
+       {
                if (optind >= argc || argv[optind][0] != sw
                || argv[optind][1] == eos)
                        return EOF;
@@ -67,6 +68,7 @@ printf("DF_TRACE_DEBUG:       int getopt () in getopt.c\n");
                        optind++;
                        return EOF;
                }
+       }
        c = argv[optind][sp];
        optopt = (int) c;
        if (c == arg || (cp = strchr(opts,c)) == NULL)
index e1554a5cb46bf547f7cd69105cd904487e33965c..9552082d47fc4473eeee5f040467cc0ce5893b1a 100644 (file)
@@ -76,13 +76,13 @@ int srv_install(LPCTSTR lpszServiceName, LPCTSTR lpszBinaryPathName)
                                "REG_SZ", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, 
                                &dwDisposition) != ERROR_SUCCESS)
                        {
-                               fprintf( stderr, "RegCreateKeyEx() failed. GetLastError=%d (%s)\n", GetLastError(), GetLastErrorString() );
+                               fprintf( stderr, "RegCreateKeyEx() failed. GetLastError=%lu (%s)\n", GetLastError(), GetLastErrorString() );
                                RegCloseKey(hKey);
                                return(0);
                        }
                        if ( RegSetValueEx(hKey, "EventMessageFile", 0, REG_EXPAND_SZ, lpszBinaryPathName, strlen(lpszBinaryPathName) + 1) != ERROR_SUCCESS)
                        {
-                               fprintf( stderr, "RegSetValueEx(EventMessageFile) failed. GetLastError=%d (%s)\n", GetLastError(), GetLastErrorString() );
+                               fprintf( stderr, "RegSetValueEx(EventMessageFile) failed. GetLastError=%lu (%s)\n", GetLastError(), GetLastErrorString() );
                                RegCloseKey(hKey);
                                return(0);
                        }
@@ -90,7 +90,7 @@ int srv_install(LPCTSTR lpszServiceName, LPCTSTR lpszBinaryPathName)
                        dwValue = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE;
                        if ( RegSetValueEx(hKey, "TypesSupported", 0, REG_DWORD, (LPBYTE) &dwValue, sizeof(DWORD)) != ERROR_SUCCESS) 
                        {
-                               fprintf( stderr, "RegCreateKeyEx(TypesSupported) failed. GetLastError=%d (%s)\n", GetLastError(), GetLastErrorString() );
+                               fprintf( stderr, "RegCreateKeyEx(TypesSupported) failed. GetLastError=%lu (%s)\n", GetLastError(), GetLastErrorString() );
                                RegCloseKey(hKey);
                                return(0);
                        }
@@ -99,13 +99,13 @@ int srv_install(LPCTSTR lpszServiceName, LPCTSTR lpszBinaryPathName)
                }
                else
                {
-                       fprintf( stderr, "CreateService() failed. GetLastError=%d (%s)\n", GetLastError(), GetLastErrorString() );
+                       fprintf( stderr, "CreateService() failed. GetLastError=%lu (%s)\n", GetLastError(), GetLastErrorString() );
                        CloseServiceHandle(schSCManager);
                        return(0);
                }
        }
        else
-               fprintf( stderr, "OpenSCManager() failed. GetLastError=%d (%s)\n", GetLastError(), GetLastErrorString() );
+               fprintf( stderr, "OpenSCManager() failed. GetLastError=%lu (%s)\n", GetLastError(), GetLastErrorString() );
        return(0);
 }
 
@@ -125,20 +125,20 @@ int srv_remove(LPCTSTR lpszServiceName, LPCTSTR lpszBinaryPathName)
                                CloseServiceHandle(schSCManager);
                                return(1);
                        } else {
-                               fprintf( stderr, "DeleteService() failed. GetLastError=%d (%s)\n", GetLastError(), GetLastErrorString() );
+                               fprintf( stderr, "DeleteService() failed. GetLastError=%lu (%s)\n", GetLastError(), GetLastErrorString() );
                                fprintf( stderr, "The %s service has not been removed.\n", lpszBinaryPathName);
                                CloseServiceHandle(schService);
                                CloseServiceHandle(schSCManager);
                                return(0);
                        }
                } else {
-                       fprintf( stderr, "OpenService() failed. GetLastError=%d (%s)\n", GetLastError(), GetLastErrorString() );
+                       fprintf( stderr, "OpenService() failed. GetLastError=%lu (%s)\n", GetLastError(), GetLastErrorString() );
                        CloseServiceHandle(schSCManager);
                        return(0);
                }
        }
        else
-               fprintf( stderr, "OpenSCManager() failed. GetLastError=%d (%s)\n", GetLastError(), GetLastErrorString() );
+               fprintf( stderr, "OpenSCManager() failed. GetLastError=%lu (%s)\n", GetLastError(), GetLastErrorString() );
        return(0);
 }
 
@@ -335,7 +335,7 @@ void LogSlapdStartedEvent( char *svc, int slap_debug, char *configfile, char *ur
        Inserts[i++] = ldap_pvt_strdup( is_NT_Service ? "svc" : "cmd" );
 
        ReportEvent( hEventLog, EVENTLOG_INFORMATION_TYPE, 0,
-               MSG_SLAPD_STARTED, NULL, i, 0, Inserts, NULL );
+               MSG_SLAPD_STARTED, NULL, i, 0, (LPCSTR *) Inserts, NULL );
 
        for ( j = 0; j < i; j++ )
                ldap_memfree( Inserts[j] );