diff --git a/ChangeLog b/ChangeLog
index fd9adb39943abd543e9afd05665fd7347a7b1115..e5acf35546446ac1e1704321d325f1a702e6e9bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-07-17  Mike Frysinger  <vapier@gentoo.org>
+	* src/browser.c (browser_refresh): Use the proper type (off_t) for
+	the size of a file, and avoid warnings about too large bit shifts.
+
 2015-07-15  Benno Schulenberg  <bensberg@justemail.net>
 	* src/nano.c, src/rcfile.c, doc/nanorc.sample.in, doc/man/nano.1,
 	doc/man/nanorc.5, doc/texinfo/nano.texi, doc/syntax/nanorc.nanorc:
diff --git a/src/browser.c b/src/browser.c
index 3191e55793858371f2b08f8cd36eabd56ee26a40..faba2a1789d76bf9fa8bb7e846d1f72e5ad92bad 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -24,6 +24,7 @@
 
 #include "proto.h"
 
+#include <stdint.h>
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
@@ -637,7 +638,7 @@ void browser_refresh(void)
 	    } else
 		foo = mallocstrcpy(NULL, _("(dir)"));
 	} else {
-	    unsigned long result = st.st_size;
+	    off_t result = st.st_size;
 	    char modifier;
 
 	    foo = charalloc(foomaxlen + 1);
@@ -655,10 +656,10 @@ void browser_refresh(void)
 		modifier = 'G';  /* gigabytes */
 	    }
 
-	    /* If less than a terabyte, or if numbers can't even go
-	     * that high, show the size, otherwise show "(huge)". */
-	    if (st.st_size < (1 << 40) || (1 << 40) == 0)
-		sprintf(foo, "%4lu %cB", result, modifier);
+	    /* Show the size if less than a terabyte,
+	     * otherwise show "(huge)". */
+	    if (result < (1 << 10))
+		sprintf(foo, "%4ju %cB", (intmax_t)result, modifier);
 	    else
 		/* TRANSLATORS: Try to keep this at most 7 characters.
 		 * If necessary, you can leave out the parentheses. */