mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Code refactor
This commit is contained in:
parent
7cb2d22e9f
commit
bd653ac91e
2
Makefile
2
Makefile
|
@ -18,7 +18,7 @@ else
|
|||
LDLIBS_CURSES ?= -lncurses
|
||||
endif
|
||||
|
||||
CFLAGS += -Wall -Wextra -Wno-unused-parameter
|
||||
CFLAGS += -Wall -Wextra -Wno-unused-parameter -Wno-format-truncation
|
||||
CFLAGS += $(CFLAGS_OPTIMIZATION)
|
||||
CFLAGS += $(CFLAGS_CURSES)
|
||||
|
||||
|
|
|
@ -2019,7 +2019,7 @@ static char *coolsize(off_t size)
|
|||
{
|
||||
static const char * const U = "BKMGTPEZY";
|
||||
static char size_buf[12]; /* Buffer to hold human readable size */
|
||||
static off_t rem;
|
||||
off_t rem;
|
||||
int i;
|
||||
|
||||
rem = i = 0;
|
||||
|
@ -2067,9 +2067,9 @@ static char *coolsize(off_t size)
|
|||
}
|
||||
|
||||
if (i > 0 && i < 6)
|
||||
snprintf(size_buf, 12, "%lu.%0*lu%c", (ulong)size, i, (ulong)rem, U[i]);
|
||||
snprintf(size_buf, 12, "%lu.%0*lu%c", size, i, rem, U[i]);
|
||||
else
|
||||
snprintf(size_buf, 12, "%lu%c", (ulong)size, U[i]);
|
||||
snprintf(size_buf, 12, "%lu%c", size, U[i]);
|
||||
|
||||
return size_buf;
|
||||
}
|
||||
|
@ -3170,7 +3170,6 @@ nochange:
|
|||
// Single click just selects, double click also opens
|
||||
if (event.bstate != BUTTON1_DOUBLE_CLICKED)
|
||||
break;
|
||||
// fallthrough to select the file
|
||||
} else
|
||||
goto nochange; // fallthrough
|
||||
case SEL_NAV_IN: // fallthrough
|
||||
|
|
Loading…
Reference in a new issue