diff --git a/examples/ChangeLog b/examples/ChangeLog index 141bd27b..476921e7 100644 --- a/examples/ChangeLog +++ b/examples/ChangeLog @@ -1,3 +1,8 @@ +1999-03-17 Martin Baulig + + * first.c, second.c: Fixed a bug that caused a core dump when + the sysdeps code does not return all data. + 1998-11-22 Martin Baulig * netload.c: Call inet_ntoa () to get address and subnet diff --git a/examples/first.c b/examples/first.c index 2d28995b..6bfdcc15 100644 --- a/examples/first.c +++ b/examples/first.c @@ -344,7 +344,7 @@ main (int argc, char *argv []) printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid, (unsigned long) data.proc_args.flags, (unsigned long) data.proc_args.size, - args); + args ? args : ""); glibtop_free (args); @@ -454,7 +454,7 @@ main (int argc, char *argv []) printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) ppid, (unsigned long) data.proc_args.flags, (unsigned long) data.proc_args.size, - args); + args ? args : ""); glibtop_free (args); @@ -565,7 +565,7 @@ main (int argc, char *argv []) printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", 1, (unsigned long) data.proc_args.flags, (unsigned long) data.proc_args.size, - args); + args ? args : ""); glibtop_free (args); diff --git a/examples/second.c b/examples/second.c index 5a9cccfa..f5e6bc91 100644 --- a/examples/second.c +++ b/examples/second.c @@ -150,7 +150,7 @@ output (pid_t pid) printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid, (unsigned long) data.proc_args.flags, (unsigned long) data.proc_args.size, - args); + args ? args : ""); glibtop_free (args);