Introduce mem_size() and New() and start using it.

This commit is contained in:
Markus F.X.J. Oberhumer
2016-09-20 15:24:07 +02:00
parent 8d433f2580
commit 44248f19b5
8 changed files with 102 additions and 65 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ void do_one_file(const char *iname, char *oname)
throwIOException("empty file -- skipped");
if (st.st_size < 512)
throwIOException("file is too small -- skipped");
if (st.st_size >= 1024*1024*1024)
if (!mem_size_valid(1, st.st_size))
throwIOException("file is too large -- skipped");
if ((st.st_mode & S_IWUSR) == 0)
{