From ce35181bc6cb5742becfd8c0eb721cb7cfa9e61a Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Thu, 7 May 2020 19:25:37 +0200 Subject: [PATCH] debug --- main.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/main.c b/main.c index bdc905b..a17a9ba 100644 --- a/main.c +++ b/main.c @@ -110,15 +110,12 @@ int getprocinfo( int ppid, char cmdline[], char cmd[], char user[], char host_ip time_t timet=0; getutmp( pid, user, host_ip, &timet ); - if ( timet != 0) - { - sprintf(date, "%s", ctime(&timet)); - }else + if ( timet == 0) { time( &timet ); - sprintf( date, "%s", ctime(&timet) ); - date[strlen(date)-1] = 0; } + sprintf( date, "%s", ctime(&timet) ); + date[strlen(date)-1] = 0; while ( flag == 0) { r = getpids( pid, child_pid ); @@ -289,7 +286,7 @@ int main() perror(logfile); return 7; } - fprintf(fh1, "%s: %s Connecté depuis %s - %s %s\n", date, host_ip, user, cmd, cmdline); + fprintf(fh1, "%s: %s Connecté depuis %s - %s %s\n", date, user, host_ip, cmd, cmdline); fclose(fh1); } }