From 6017df40ffdcbbee9a7bdac3cf54180690781f54 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Wed, 6 May 2020 17:19:43 +0200 Subject: [PATCH] debug --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index a966d5f..ca87dec 100644 --- a/main.c +++ b/main.c @@ -133,8 +133,8 @@ int getprocinfo( int ppid, char cmdline[], char cmd[], char user[] ) } fgets( str, 1024, fh1); null2space( str ); - pos = strstr( str, "USER="); - sprintf( user, "%s", pos+5); + pos = strstr( str, "USER=") +5; + sscanf( user, "%s", pos); fclose(fh1); return retval; }