fixed TODO: use strtol

Sun, 24 Feb 2019 15:06:25 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 24 Feb 2019 15:06:25 +0100
changeset 509
0576dd6409f3
parent 508
4575da18a27d
child 510
d6e801f97e7a

fixed TODO: use strtol

dav/main.c file | annotate | diff | comparison | revisions
--- a/dav/main.c	Sun Feb 24 14:55:59 2019 +0100
+++ b/dav/main.c	Sun Feb 24 15:06:25 2019 +0100
@@ -1998,7 +1998,13 @@
         if(!sstrcasecmp(sstr(timeoutstr), S("infinite"))) {
             timeout = -1;
         } else {
-            timeout = (time_t)atoi(timeoutstr); // TODO: use strtol
+            uint64_t i;
+            if(util_strtoint(timeoutstr)) {
+                timeout = (time_t)i;
+            } else {
+                fprintf(stderr, "Error: -T option has invalid value\n");
+                return -1;
+            }
         }
     }
     

mercurial