]> git.sur5r.net Git - i3/i3status/commitdiff
Add check for interval value 262/head
authorfoutaise <jef@foutaise.org>
Tue, 6 Feb 2018 11:30:04 +0000 (12:30 +0100)
committerfoutaise <jef@foutaise.org>
Tue, 6 Feb 2018 11:30:04 +0000 (12:30 +0100)
i3status.c

index 2cded06956d8f63b4ce1ba898d3ccaecf12055d3..5088c96c8f236d80de1375e4b43d40f584165080 100644 (file)
@@ -631,6 +631,11 @@ int main(int argc, char *argv[]) {
         die("Could not create socket\n");
 
     int interval = cfg_getint(cfg_general, "interval");
         die("Could not create socket\n");
 
     int interval = cfg_getint(cfg_general, "interval");
+    if (interval <= 0) {
+        die("Invalid interval attribute found in section %s, line %d: %d\n"
+            "Expected positive integer\n",
+            cfg_general->name, cfg_general->line, interval);
+    }
 
     /* One memory page which each plugin can use to buffer output.
      * Even though it’s unclean, we just assume that the user will not
 
     /* One memory page which each plugin can use to buffer output.
      * Even though it’s unclean, we just assume that the user will not