Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/kondo_preprocess.c')
-rw-r--r--src/kondo_preprocess.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/kondo_preprocess.c b/src/kondo_preprocess.c
index 3371014..c472e9d 100644
--- a/src/kondo_preprocess.c
+++ b/src/kondo_preprocess.c
@@ -1,5 +1,5 @@
/*
-Copyright 2015 Ian Jauslin
+Copyright 2015-2022 Ian Jauslin
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -104,6 +104,11 @@ for(i=1;i<argc;i++){
// number of dimensions
else if (flag==CP_FLAG_DIMENSION){
sscanf(argv[i],"%d",&((*opts).dimension));
+ // check value of the dimension
+ if((*opts).dimension<=0 || (*opts).dimension>=4){
+ fprintf(stderr,"error: kondo_preprocess only supports dimensions 1, 2 and 3 (got %d)\n",(*opts).dimension);
+ exit(-1);
+ }
flag=0;
}
// read file name from command-line