diff options
| author | 2019-09-10 20:26:08 +0530 | |
|---|---|---|
| committer | 2019-09-10 20:26:08 +0530 | |
| commit | d33f4692965ae9c30aecf33aba415fc446a3a33a (patch) | |
| tree | 9b9f4d4304dfdf1fa42ef02e3be48350ed6e9218 /src | |
| parent | a064818acf4a3632934421fb94ea84cab059d59f (diff) | |
| download | nnn-d33f4692965ae9c30aecf33aba415fc446a3a33a.tar.gz | |
Remove redundant variable
Diffstat (limited to 'src')
| -rw-r--r-- | src/nnn.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -3152,7 +3152,6 @@ static void redraw(char *path) int ncols = (xcols <= PATH_MAX) ? xcols : PATH_MAX; int lastln = xlines, onscreen = xlines - 4; int i, attrs; - size_t len = strlen(path); char buf[12]; char c; char *ptr = path, *base; @@ -3207,25 +3206,26 @@ static void redraw(char *path) attron(A_UNDERLINE); /* Print path */ - if ((len + 11) <= (size_t)ncols) + i = (int)strlen(path); + if ((i + 11) <= ncols) addnstr(path, ncols - 11); else { base = xbasename(path); if ((base - ptr) <= 1) addnstr(path, ncols - 11); else { - len = 0; + i = 0; --base; while (ptr < base) { if (*ptr == '/') { addch(*ptr); addch(*(++ptr)); - len += 2; /* 2 characters added */ + i += 2; /* 2 characters added */ } ++ptr; } - addnstr(base, ncols - (11 + len + 1)); + addnstr(base, ncols - (11 + i)); } } |