flip check for row_count with setting for better code logic
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 10 Jun 2008 11:16:40 +0000 (11:16 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 10 Jun 2008 11:16:40 +0000 (11:16 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1425 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd_create.c

index 6d7cb18..00018d3 100644 (file)
@@ -314,9 +314,9 @@ int rrd_create_r(
                     case CF_DEVPREDICT:
                     case CF_FAILURES:
                         row_cnt = atoi(token);
-                        rrd.rra_def[rrd.stat_head->rra_cnt].row_cnt = row_cnt;
                         if (row_cnt <= 0)
                             rrd_set_error("Invalid row count: %i", row_cnt);
+                        rrd.rra_def[rrd.stat_head->rra_cnt].row_cnt = row_cnt;
                         break;
                     default:
                         rrd.rra_def[rrd.stat_head->rra_cnt].
@@ -420,9 +420,9 @@ int rrd_create_r(
                         break;
                     default:
                         row_cnt = atoi(token);
-                        rrd.rra_def[rrd.stat_head->rra_cnt].row_cnt = row_cnt;
                         if (row_cnt <= 0)
                             rrd_set_error("Invalid row count: %i", row_cnt);
+                        rrd.rra_def[rrd.stat_head->rra_cnt].row_cnt = row_cnt;
                         break;
                     }
                     break;