diff options
author | Kevin Chabowski <kevin@kch42.de> | 2013-08-05 15:10:04 +0200 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2013-08-05 15:10:04 +0200 |
commit | 2866916469e8d62bc7b0a5d0f697eff1375a1881 (patch) | |
tree | a6c5fc6bfc25f8ba7c8dc3200b2de180492bc2fc | |
parent | 4627f895d1f266b2c0a18c952a1eb703e59aeeb9 (diff) | |
download | nebula2-2866916469e8d62bc7b0a5d0f697eff1375a1881.tar.gz nebula2-2866916469e8d62bc7b0a5d0f697eff1375a1881.tar.bz2 nebula2-2866916469e8d62bc7b0a5d0f697eff1375a1881.zip |
Iteration values must be in ascending order!
-rw-r--r-- | config.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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; |