Code

Fix for #167 - rrdcreate is arguably missing a check for 'step>=1' for RRAs with...
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 22 Jul 2008 15:15:44 +0000 (15:15 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 22 Jul 2008 15:15:44 +0000 (15:15 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@1445 a5681a0c-68f1-0310-ab6d-d61299d08faa

program/src/rrd_create.c

index d9ab8f484f63addba1209fbe2cadb06c4016af7e..186b3b40fa6e92818e759b0e63ecc998363327c6 100644 (file)
@@ -312,6 +312,8 @@ rrd_create_r(const char *filename,
                         break;
                     default:
                         rrd.rra_def[rrd.stat_head->rra_cnt].pdp_cnt = atoi(token);
+                        if (atoi(token) < 1) 
+                            rrd_set_error("Invalid step: must be >= 1"); 
                         break;
                     }
                     break;