From 7db1ed695c3d11e67395a175f35659a683bd14b7 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Wed, 17 Mar 1999 18:33:25 +0000 Subject: [PATCH] Fixed a bug that caused a core dump when the sysdeps code does not return 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. --- examples/ChangeLog | 5 +++++ examples/first.c | 6 +++--- examples/second.c | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) 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);