]> Sergey Matveev's repositories - nnn.git/commitdiff
Fix build break
authorArun Prakash Jana <engineerarun@gmail.com>
Thu, 9 May 2019 13:15:47 +0000 (18:45 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Wed, 22 May 2019 03:14:19 +0000 (08:44 +0530)
Makefile
src/nnn.c

index 8750af08f07a0d1c01335fdd2c7abd0ece16ab79..7dcf5eb7517f4e571f3127000df86def6ec56d24 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ else
        LDLIBS_CURSES ?= -lncurses
 endif
 
-CFLAGS += -Wall -Wextra -Wno-unused-parameter -Wno-format-truncation
+CFLAGS += -Wall -Wextra -Wno-unused-parameter
 CFLAGS += $(CFLAGS_OPTIMIZATION)
 CFLAGS += $(CFLAGS_CURSES)
 
index 3d66b1ddb6a2d848466bd136b6c1277233b6693e..50acd352372ecfe819e67a2ab6526c84b071ddb9 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -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 */
-       off_t rem;
+       static 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", size, i, rem, U[i]);
+               snprintf(size_buf, 12, "%lu.%0*lu%c", (ulong)size, i, (ulong)rem, U[i]);
        else
-               snprintf(size_buf, 12, "%lu%c", size, U[i]);
+               snprintf(size_buf, 12, "%lu%c", (ulong)size, U[i]);
 
        return size_buf;
 }