summaryrefslogtreecommitdiff
path: root/examples/second.c
diff options
context:
space:
mode:
authorMartin Baulig <martin@home-of-linux.org>1998-12-09 11:38:49 +0000
committerMartin Baulig <martin@src.gnome.org>1998-12-09 11:38:49 +0000
commit1520ee70838db2a183415aaea3ec865ff6ce13ad (patch)
tree2e1494a1ab01fa7f77422f2c990b4f5eebf605cd /examples/second.c
parentee9812e9af80d85b1a1b016e48cd4c0c9bda381e (diff)
downloadlibgtop-1520ee70838db2a183415aaea3ec865ff6ce13ad.tar.gz
Make the return value a `char *' instead of a `const char *'.
1998-12-09 Martin Baulig <martin@home-of-linux.org> * include/glibtop/procargs.h (glibtop_get_proc_args): Make the return value a `char *' instead of a `const char *'.
Diffstat (limited to 'examples/second.c')
-rw-r--r--examples/second.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/second.c b/examples/second.c
index faa658fa..e997ec46 100644
--- a/examples/second.c
+++ b/examples/second.c
@@ -36,13 +36,15 @@ output (pid_t pid)
{
glibtop_union data;
char *args;
+ unsigned i;
+
#if HAVE_LIBGTOP_SMP
unsigned long total;
double p_total, p_utime, p_stime;
double b_total, b_utime, b_stime;
double s_total, s_utime, s_stime;
double my_utime, my_stime;
- int ncpu, i;
+ int ncpu;
#endif
printf ("\n");
@@ -138,6 +140,11 @@ output (pid_t pid)
args = glibtop_get_proc_args (&data.proc_args, pid, 0);
+ for (i = 0; i < data.proc_args.size; i++) {
+ if (args [i]) continue;
+ args [i] = '|';
+ }
+
printf ("Proc_Args PID %5d (0x%08lx): %lu - '%s'\n", (int) pid,
(unsigned long) data.proc_args.flags,
(unsigned long) data.proc_args.size,