summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2013-08-05 15:10:04 +0200
committerKevin Chabowski <kevin@kch42.de>2013-08-05 15:10:04 +0200
commit2866916469e8d62bc7b0a5d0f697eff1375a1881 (patch)
treea6c5fc6bfc25f8ba7c8dc3200b2de180492bc2fc
parent4627f895d1f266b2c0a18c952a1eb703e59aeeb9 (diff)
downloadnebula2-2866916469e8d62bc7b0a5d0f697eff1375a1881.tar.gz
nebula2-2866916469e8d62bc7b0a5d0f697eff1375a1881.tar.bz2
nebula2-2866916469e8d62bc7b0a5d0f697eff1375a1881.zip
Iteration values must be in ascending order!
-rw-r--r--config.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/config.c b/config.c
index 72843e8..d810d8f 100644
--- a/config.c
+++ b/config.c
@@ -97,6 +97,7 @@ conf_load(char* path, config_t** conf) {
int i;
dictionary* ini = NULL;
char namebuf[NAMEBUF_SIZE];
+ int last_iter = 0;
if(!(*conf = malloc(sizeof(config_t)))) {
fputs("Could not allocate memory.\n", stderr);
@@ -164,6 +165,12 @@ conf_load(char* path, config_t** conf) {
goto failed;
}
+ if((*conf)->iters[i] <= last_iter) {
+ fputs("iterX values must be in ascending order.\n", stderr);
+ goto failed;
+ }
+ last_iter = (*conf)->iters[i];
+
if(snprintf(namebuf, NAMEBUF_SIZE, "nebula2:color%d", i) < 0) {
fputs("Error while reading colorX values.\n", stderr);
goto failed;