diff --git a/main.c b/main.c index 2ab1953..859eb6a 100644 --- a/main.c +++ b/main.c @@ -123,8 +123,8 @@ int getprocinfo( int ppid, char cmdline[], char cmd[], char user[] ) return 5; } fgets( str, 1024, fh1); - pos = strstr( str, "USER=") + 5; - sprintf( user, "%s", pos); + pos = strstr( str, "USER="); + sprintf( user, "%s", pos+5); fclose(fh1); return retval; }