bug fix: file size > 2gb not loaded correctly from database v1.0

Thu, 07 Sep 2017 18:42:51 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 07 Sep 2017 18:42:51 +0200
branch
v1.0
changeset 301
cbea102875a8
parent 294
dd5c0ebdf54f
child 303
5d79c108fcab

bug fix: file size > 2gb not loaded correctly from database

this bug results in large files always pushed, even if they are unmodified

dav/db.c file | annotate | diff | comparison | revisions
--- a/dav/db.c	Tue Sep 05 12:00:49 2017 +0200
+++ b/dav/db.c	Thu Sep 07 18:42:51 2017 +0200
@@ -152,7 +152,13 @@
                     break;
                 }
                 case 3: {
-                    res->size = atoi((char*)value);
+                    res->size = 0;
+                    int64_t filelen = 0;
+                    if(util_strtoint((char*)value, &filelen)) {
+                        if(filelen > 0) {
+                            res->size = (size_t)filelen;
+                        }
+                    }
                     break;
                 }
             }

mercurial