* pinfo.cc (commune_process): Don't add extra \0 to cmdline.

(_pinfo::cmdline): Ditto process internal.
This commit is contained in:
Corinna Vinschen 2006-07-19 16:00:28 +00:00
parent add2f65f37
commit 9d272b3c31
2 changed files with 7 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2006-07-19 Corinna Vinschen <corinna@vinschen.de>
* pinfo.cc (commune_process): Don't add extra \0 to cmdline.
(_pinfo::cmdline): Ditto process internal.
2006-07-19 Corinna Vinschen <corinna@vinschen.de> 2006-07-19 Corinna Vinschen <corinna@vinschen.de>
* mmap.cc (msync): Disable rounding up len. Fix bug in access check * mmap.cc (msync): Disable rounding up len. Fix bug in access check

View File

@ -418,7 +418,7 @@ commune_process (void *arg)
case PICOM_CMDLINE: case PICOM_CMDLINE:
{ {
sigproc_printf ("processing PICOM_CMDLINE"); sigproc_printf ("processing PICOM_CMDLINE");
unsigned n = 1; unsigned n = 0;
extern int __argc_safe; extern int __argc_safe;
const char *argv[__argc_safe + 1]; const char *argv[__argc_safe + 1];
@ -443,11 +443,6 @@ commune_process (void *arg)
sigproc_printf ("WriteFile arg %d failed, %E", a - argv); sigproc_printf ("WriteFile arg %d failed, %E", a - argv);
break; break;
} }
if (!WriteFile (tothem, "", 1, &nr, NULL))
{
sigproc_printf ("WriteFile null failed, %E");
break;
}
break; break;
} }
case PICOM_CWD: case PICOM_CWD:
@ -819,7 +814,7 @@ _pinfo::cmdline (size_t& n)
} }
else else
{ {
n = 1; n = 0;
for (char **a = __argv; *a; a++) for (char **a = __argv; *a; a++)
n += strlen (*a) + 1; n += strlen (*a) + 1;
char *p; char *p;
@ -829,7 +824,6 @@ _pinfo::cmdline (size_t& n)
strcpy (p, *a); strcpy (p, *a);
p = strchr (p, '\0') + 1; p = strchr (p, '\0') + 1;
} }
*p = '\0';
} }
return s; return s;
} }