summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;