From 69d73a85bd4b9d9a87c820b1f8706577a169003b Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Wed, 6 May 2020 16:36:48 +0200 Subject: [PATCH] debug --- main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index e614039..3fd553f 100644 --- a/main.c +++ b/main.c @@ -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++) {