Code

Fixed reading too many argv parameters and changed to asprintf
authorTon Voon <tonvoon@users.sourceforge.net>
Tue, 11 Mar 2003 22:34:11 +0000 (22:34 +0000)
committerTon Voon <tonvoon@users.sourceforge.net>
Tue, 11 Mar 2003 22:34:11 +0000 (22:34 +0000)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@397 f882894a-f735-0410-b71e-b25c423dba1c

plugins/negate.c

index e10c78dfb5247a65c2d8016c748276e3d121d4ab..1603342bb1727523336b80216bb9de3868f8d1ed 100644 (file)
@@ -259,8 +259,8 @@ process_arguments (int argc, char **argv)
                }
        }
 
-       command_line = strscpy (command_line, argv[optind]);
-       for (c = optind+1; c <= argc; c++) {
+       asprintf (&command_line, "%s", argv[optind]);
+       for (c = optind+1; c < argc; c++) {
                asprintf (&command_line, "%s %s", command_line, argv[c]);
        }