diff options
-rw-r--r-- | plugins/check_procs.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/check_procs.c b/plugins/check_procs.c index 3849c77..4187a07 100644 --- a/plugins/check_procs.c +++ b/plugins/check_procs.c | |||
@@ -72,10 +72,10 @@ int options = 0; /* bitmask of filter criteria to test against */ | |||
72 | int verbose = FALSE; | 72 | int verbose = FALSE; |
73 | int uid; | 73 | int uid; |
74 | int ppid; | 74 | int ppid; |
75 | char *statopts = NULL; | 75 | char *statopts = ""; |
76 | char *prog = NULL; | 76 | char *prog = ""; |
77 | char *args = NULL; | 77 | char *args = ""; |
78 | char *fmt = NULL; | 78 | char *fmt = ""; |
79 | char tmp[MAX_INPUT_BUFFER]; | 79 | char tmp[MAX_INPUT_BUFFER]; |
80 | 80 | ||
81 | int | 81 | int |
@@ -275,8 +275,6 @@ process_arguments (int argc, char **argv) | |||
275 | }; | 275 | }; |
276 | #endif | 276 | #endif |
277 | 277 | ||
278 | asprintf (&fmt, ""); | ||
279 | |||
280 | for (c = 1; c < argc; c++) | 278 | for (c = 1; c < argc; c++) |
281 | if (strcmp ("-to", argv[c]) == 0) | 279 | if (strcmp ("-to", argv[c]) == 0) |
282 | strcpy (argv[c], "-t"); | 280 | strcpy (argv[c], "-t"); |
@@ -351,7 +349,7 @@ process_arguments (int argc, char **argv) | |||
351 | } | 349 | } |
352 | case 'p': /* process id */ | 350 | case 'p': /* process id */ |
353 | if (sscanf (optarg, "%d%[^0-9]", &ppid, tmp) == 1) { | 351 | if (sscanf (optarg, "%d%[^0-9]", &ppid, tmp) == 1) { |
354 | asprintf (&fmt, "%s%sPPID = %d", (options ? ", " : ""), ppid); | 352 | asprintf (&fmt, "%s%sPPID = %d", fmt, (options ? ", " : ""), ppid); |
355 | options |= PPID; | 353 | options |= PPID; |
356 | break; | 354 | break; |
357 | } | 355 | } |
@@ -387,7 +385,7 @@ process_arguments (int argc, char **argv) | |||
387 | uid = pw->pw_uid; | 385 | uid = pw->pw_uid; |
388 | } | 386 | } |
389 | user = pw->pw_name; | 387 | user = pw->pw_name; |
390 | asprintf (&fmt, "%s%sUID = %d (%s)", (options ? ", " : ""), fmt, | 388 | asprintf (&fmt, "%s%sUID = %d (%s)", fmt, (options ? ", " : ""), |
391 | uid, user); | 389 | uid, user); |
392 | options |= USER; | 390 | options |= USER; |
393 | break; | 391 | break; |