libps
Hi All,
ps.h states on lines 257-260 that:
/* The process's argv, as a string with each element separated by '\0'. */
char *args;
/* The length of ARGS. */
unsigned args_len;
It actually contains that plus an extra null at the end.
If this is really a bug, this should fix it:
--- /src/hurd/proc/info.c Sun Jul 11 01:32:01 1999
+++ info.c Sun Jan 23 01:24:12 2000
@@ -306,6 +306,9 @@
bp += len;
free (string);
}
+ /* We always have an extra null at the end, remove it */
+ bp--;
+
free (vector);
*buflen = bp - (char *) *buf;
return 0;
HSFYA
-Neal
--
----------------------------------------------------------------------------
Neal Walfield neal@walfield.org
UMass Lowell - Fox 1512 Phone: 978-934-5347
Fax: 603-415-3645
Love is the triumph of imagination over intelligence.
-- H. L. Mencken
Reply to:
- Follow-Ups:
- Re: libps
- From: Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>
- Re: libps
- From: Roland McGrath <roland@frob.com>