From 1fde10b022d939229170368f016a495651259d1e Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sun, 25 Apr 2021 15:05:06 +0530 Subject: [PATCH] Fix LGTM alerts --- misc/natool/natool | 2 +- src/nnn.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/misc/natool/natool b/misc/natool/natool index 0b00066c..237a3ace 100755 --- a/misc/natool/natool +++ b/misc/natool/natool @@ -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]') diff --git a/src/nnn.c b/src/nnn.c index ea408d16..5928b4ba 100644 --- 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)