aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-03-05 01:04:01 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-03-08 04:49:43 +0530
commit0c63f474a3925dc870dca09d48f1a228dd98105b (patch)
tree7d5041f036abee3654f5ddc501558f29c7e5dfdc
parent197bedc6ffee25877f8c01a4dd8766fd249f429d (diff)
downloadnnn-0c63f474a3925dc870dca09d48f1a228dd98105b.tar.gz
Checkpatch fixes
-rw-r--r--src/nnn.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 9b76fe2..f1c846b 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -768,6 +768,7 @@ static char *xdirname(const char *path)
static char *xbasename(char *path)
{
char *base = xmemrchr((uchar *)path, '/', strlen(path));
+
return base ? base + 1 : path;
}
@@ -788,7 +789,7 @@ static uint xatoi(const char *str)
static char *xitoa(uint val)
{
- const char hexbuf[] = "0123456789";
+ static const char hexbuf[] = "0123456789";
static char ascbuf[32] = {0};
int i;
@@ -917,7 +918,7 @@ static bool cpsafe(void)
}
/* Reset copy indicators */
-static void resetcpind()
+static void resetcpind(void)
{
int r = 0;
@@ -1477,8 +1478,8 @@ static int (*filterfn)(regex_t *regex, const char *fname, const char *fltr) = &v
static int entrycmp(const void *va, const void *vb)
{
- const struct entry * pa = (pEntry)va;
- const struct entry * pb = (pEntry)vb;
+ const struct entry *pa = (pEntry)va;
+ const struct entry *pb = (pEntry)vb;
if ((pb->flags & DIR_OR_LINK_TO_DIR) != (pa->flags & DIR_OR_LINK_TO_DIR)) {
if (pb->flags & DIR_OR_LINK_TO_DIR)
@@ -1969,6 +1970,7 @@ static char *get_bm_loc(char *buf, int key)
}
ssize_t count = xstrlcpy(buf, home, PATH_MAX);
+
xstrlcpy(buf + count - 1, bookmark[r].loc + 1, PATH_MAX - count - 1);
} else
xstrlcpy(buf, bookmark[r].loc, PATH_MAX);
@@ -2830,6 +2832,7 @@ static void redraw(char *path)
printptr(&dents[i], i == cur, ncols);
} else {
const int odd = ISODD(nlines);
+
nlines >>= 1;
for (i = cur - nlines; i < cur + nlines + odd; ++i)
printptr(&dents[i], i == cur, ncols);
@@ -3689,7 +3692,7 @@ nochange:
}
(r == 'y' || r == 'Y') ? archive_selection(tmp, path)
- : spawn(utils[APACK], tmp, dents[cur].name,
+ : spawn(utils[APACK], tmp, dents[cur].name,
path, F_NORMAL);
break;
case SEL_OPENWITH: