aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-05-17 00:34:50 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-05-22 08:48:44 +0530
commitace449c0e98b016ab6f8d7d1d83c0a60b4dd9bc6 (patch)
treec2a3a7bfdfb369a07c8376cc2210684c728b92e4 /src/nnn.c
parente83f4ca62f91aadf6c576f96a0ea1524edcc3851 (diff)
downloadnnn-ace449c0e98b016ab6f8d7d1d83c0a60b4dd9bc6.tar.gz
Simpler permission string generation
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 3486a83..65c6562 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2126,12 +2126,9 @@ static void printent_long(const struct entry *ent, int sel, uint namecols)
strftime(timebuf, 18, "%F %R", localtime(&ent->t));
/* Permissions */
- permbuf[0] = *xitoa((ent->mode >> 6) & 7);
- permbuf[0] = permbuf[0] ? permbuf[0] : '0';
- permbuf[1] = *xitoa((ent->mode >> 3) & 7);
- permbuf[1] = permbuf[1] ? permbuf[1] : '0';
- permbuf[2] = *xitoa(ent->mode & 7);
- permbuf[2] = permbuf[2] ? permbuf[2] : '0';
+ permbuf[0] = '0' + ((ent->mode >> 6) & 7);
+ permbuf[1] = '0' + ((ent->mode >> 3) & 7);
+ permbuf[2] = '0' + (ent->mode & 7);
permbuf[3] = '\0';
/* Trim escape chars from name */