diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2003-01-29 04:11:49 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2003-01-29 04:11:49 +0000 |
commit | 4ad2c31c4e157d6392e9846debdfaf38e1cdda30 (patch) | |
tree | 81500f69e8fa97aba0e91999e5b49ecdd900d75d | |
parent | 489f4501f8d6bc1f53b4c808ecade65e7b0175cd (diff) | |
download | monitoring-plugins-4ad2c31c4e157d6392e9846debdfaf38e1cdda30.tar.gz |
Fixed NULL status in Solaris (644783 - Fabian Pehla)
Fixed -p options (652082 - Ton Voon)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@261 f882894a-f735-0410-b71e-b25c423dba1c
-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 3849c776..4187a079 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 */ int verbose = FALSE; int uid; int ppid; -char *statopts = NULL; -char *prog = NULL; -char *args = NULL; -char *fmt = NULL; +char *statopts = ""; +char *prog = ""; +char *args = ""; +char *fmt = ""; char tmp[MAX_INPUT_BUFFER]; int @@ -275,8 +275,6 @@ process_arguments (int argc, char **argv) }; #endif - asprintf (&fmt, ""); - for (c = 1; c < argc; c++) if (strcmp ("-to", argv[c]) == 0) strcpy (argv[c], "-t"); @@ -351,7 +349,7 @@ process_arguments (int argc, char **argv) } case 'p': /* process id */ if (sscanf (optarg, "%d%[^0-9]", &ppid, tmp) == 1) { - asprintf (&fmt, "%s%sPPID = %d", (options ? ", " : ""), ppid); + asprintf (&fmt, "%s%sPPID = %d", fmt, (options ? ", " : ""), ppid); options |= PPID; break; } @@ -387,7 +385,7 @@ process_arguments (int argc, char **argv) uid = pw->pw_uid; } user = pw->pw_name; - asprintf (&fmt, "%s%sUID = %d (%s)", (options ? ", " : ""), fmt, + asprintf (&fmt, "%s%sUID = %d (%s)", fmt, (options ? ", " : ""), uid, user); options |= USER; break; |