1
0
This commit is contained in:
Daniel Tartavel 2020-05-06 16:36:48 +02:00
parent af146615e8
commit 69d73a85bd

6
main.c
View File

@ -122,8 +122,8 @@ int getprocinfo( int ppid, char cmdline[], char cmd[], char user[] )
return 5;
}
fscanf( fh1, "%s", str);
pch = strtok( str, "=" );
pch = strtok( NULL , "=" );
pch = strtok( str, "=\0" );
pch = strtok( NULL , "=\0" );
sprintf( user, "%s", pch);
fclose(fh1);
return retval;
@ -195,7 +195,7 @@ int main()
//printf("%i", pid);
//get the list of children
if ( getpids( pid, pids ) != -1)
if ( (n=getpids( pid, pids )) != -1)
{
for ( y=0; y<=n; y++)
{