Browse Source

Revert "Ticket #47835 - Coverity: 12687..12692"

This reverts commit 43c6ff2e7801ff6bbc03961b3161dd60aebf707a.
Noriko Hosoi 11 years ago
parent
commit
3a66ec7ca6
1 changed files with 5 additions and 9 deletions
  1. 5 9
      ldap/servers/slapd/tools/dbscan.c

+ 5 - 9
ldap/servers/slapd/tools/dbscan.c

@@ -1077,17 +1077,16 @@ is_changelog(char *filename)
 
 static void usage(char *argv0)
 {
-    long arg_max = sysconf(_SC_ARG_MAX);
-    char *copy = strndup(argv0, arg_max);
+    char *copy = strdup(argv0);
     char *p0 = NULL, *p1 = NULL;
-    if (copy && (strlen(copy) < arg_max)) {
+    if (NULL != copy) {
         /* the full path is not needed in the usages */
-        p0 = strrchr(copy, '/');
-        if (p0) {
+        p0 = strrchr(argv0, '/');
+        if (NULL != p0) {
             *p0 = '\0';
             p0++;
         } else {
-            p0 = copy;
+            p0 = argv0;
         }
         p1 = strrchr(p0, '-'); /* get rid of -bin from the usage */
         if (NULL != p1) {
@@ -1125,9 +1124,6 @@ static void usage(char *argv0)
     printf("    # display summary of objectclass.db4\n");
     printf("    %s -f objectclass.db4\n", p0);
     printf("\n");
-    if (copy) {
-        free(copy);
-    }
     exit(1);
 }