changeset 89:00f9b91f4039

Do not leak a byte if the file is empty
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 20 Mar 2014 18:40:15 +0000
parents abc76b750ea8
children 899fcddb92d0
files common/listutil.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/common/listutil.c	Thu Mar 20 16:58:55 2014 +0000
+++ b/common/listutil.c	Thu Mar 20 18:40:15 2014 +0000
@@ -57,7 +57,7 @@
 
     fseek(f, 0, SEEK_END);
     file_size = ftell(f);
-    if (file_size < 0){
+    if (file_size <= 0){
         fclose(f);
         return READ_FILE_UNREADABLE;
     }

http://wald.intevation.org/projects/trustbridge/