Fix checkpatch reports

This commit is contained in:
Arun Prakash Jana 2017-12-28 01:47:44 +05:30
parent 2c50c92b3d
commit 9b010b1c03

10
nnn.c
View file

@ -1094,7 +1094,8 @@ xreadline(char *fname)
} }
buf[len] = '\0'; buf[len] = '\0';
if (old_curs != ERR) curs_set(old_curs); if (old_curs != ERR)
curs_set(old_curs);
settimeout(); settimeout();
DPRINTF_S(buf); DPRINTF_S(buf);
@ -1191,6 +1192,7 @@ get_bm_loc(char *key, char *buf)
if (xstrcmp(bookmark[r].key, key) == 0) { if (xstrcmp(bookmark[r].key, key) == 0) {
if (bookmark[r].loc[0] == '~') { if (bookmark[r].loc[0] == '~') {
char *home = getenv("HOME"); char *home = getenv("HOME");
if (!home) { if (!home) {
DPRINTF_S(STR_NOHOME); DPRINTF_S(STR_NOHOME);
return NULL; return NULL;
@ -1270,6 +1272,7 @@ coolsize(off_t size)
static char size_buf[12]; /* Buffer to hold human readable size */ static char size_buf[12]; /* Buffer to hold human readable size */
static int i; static int i;
static off_t tmp; static off_t tmp;
static long double rem; static long double rem;
static const double div_2_pow_10 = 1.0 / 1024.0; static const double div_2_pow_10 = 1.0 / 1024.0;
@ -1993,6 +1996,7 @@ populate(char *path, char *oldname, char *fltr)
#ifdef DEBUGMODE #ifdef DEBUGMODE
struct timespec ts1, ts2; struct timespec ts1, ts2;
clock_gettime(CLOCK_REALTIME, &ts1); /* Use CLOCK_MONOTONIC on FreeBSD */ clock_gettime(CLOCK_REALTIME, &ts1); /* Use CLOCK_MONOTONIC on FreeBSD */
#endif #endif
@ -2741,10 +2745,10 @@ nochange:
r = getch(); r = getch();
settimeout(); settimeout();
if (r == 'f') { if (r == 'f') {
r = openat(fd, tmp, O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); r = openat(fd, tmp, O_CREAT, 0666);
close(r); close(r);
} else if (r == 'd') } else if (r == 'd')
r = mkdirat(fd, tmp, S_IRWXU | S_IRWXG | S_IRWXO); r = mkdirat(fd, tmp, 0777);
else { else {
close(fd); close(fd);
break; break;