1
0
This commit is contained in:
Daniel Tartavel 2020-05-06 19:05:56 +02:00
parent a08c4a9a83
commit e8e06e59ac

4
main.c
View File

@ -136,7 +136,7 @@ int getprocinfo( int ppid, char cmdline[], char cmd[], char user[] )
null2space( str ); null2space( str );
if ( (pos = strstr( str, "USER=")) != NULL) if ( (pos = strstr( str, "USER=")) != NULL)
{ {
sscanf( pos, "%s", user); sscanf( pos+5, "%s", user);
} }
return retval; return retval;
} }
@ -209,7 +209,7 @@ int main()
//get the list of children //get the list of children
if ( (n=getpids( pid, pids )) != -1) if ( (n=getpids( pid, pids )) != -1)
{ {
for ( y=0; y<=n; y++) for ( y=0; y<n; y++)
{ {
pid = pids[y]; pid = pids[y];
r = isinarray(pid, childrens, x); r = isinarray(pid, childrens, x);