]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix LGTM alerts
authorArun Prakash Jana <engineerarun@gmail.com>
Sun, 25 Apr 2021 09:35:06 +0000 (15:05 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 25 Apr 2021 11:24:43 +0000 (16:54 +0530)
misc/natool/natool
src/nnn.c

index 0b00066c4baa8ee815387fd35e6474bbeaf0b016..237a3ace48fac0ef74c5d414f34c0bde77b9fdbb 100755 (executable)
@@ -21,7 +21,7 @@
 # #############################################################################
 
 import sys
-from subprocess import Popen, PIPE, DEVNULL
+from subprocess import Popen, PIPE
 
 if len(sys.argv) < 3:
     print('usage: natool [-a] [-l] [-x] [archive] [file/dir]')
index ea408d163ce7997f11bb36495adcb2df0cb8f097..5928b4bafca40090fee9762f25ec187ae88b8eb6 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3603,10 +3603,11 @@ static void print_icon(const struct entry *ent, const int attrs)
 
 static void print_time(const time_t *timep)
 {
-       struct tm *t = localtime(timep);
+       struct tm t;
 
+       localtime_r(timep, &t);
        printw("%s-%02d-%02d %02d:%02d",
-               xitoa(t->tm_year + 1900), t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min);
+               xitoa(t.tm_year + 1900), t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min);
 }
 
 static char get_detail_ind(const mode_t mode)