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); } }