Fixed bug in calculation of process argument list.

* procargs.c: Fixed bug in calculation of process argument list.
This commit is contained in:
Drazen Kacar
1999-05-30 20:39:07 +00:00
parent f8f0ee6882
commit deeadb6648
2 changed files with 8 additions and 2 deletions

View File

@@ -1,3 +1,7 @@
1999-05-30 Drazen Kacar <dave@srce.hr>
* procargs.c: Fixed bug in calculation of process argument list.
1999-05-27 Drazen Kacar <dave@srce.hr>
* glibtop_machine.h, open.c, procmap.c: Get the file name

View File

@@ -44,7 +44,7 @@ glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf,
pid_t pid, unsigned max_len)
{
struct psinfo pinfo;
int len;
int len, i;
char *ret, *p;
memset (buf, 0, sizeof (glibtop_proc_args));
@@ -52,7 +52,9 @@ glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf,
if(glibtop_get_proc_data_psinfo_s(server, &pinfo, pid))
return NULL;
len = strlen(pinfo.pr_psargs);
for(len = 0; len < PRARGSZ; ++len)
if(!(pinfo.pr_psargs[len]))
break;
if(max_len)
{
ret = glibtop_malloc_r(server, max_len + 1);