X-Git-Url: http://git.treefish.org/~alex/phys/latlib.git/blobdiff_plain/ad54f29de351976a096b4991fe426ffc30332df2..238fccf7dd50a69b5825f4544b3e247bfbf4e417:/configcache.cpp?ds=inline diff --git a/configcache.cpp b/configcache.cpp index 6cd46a1..02b6d94 100644 --- a/configcache.cpp +++ b/configcache.cpp @@ -18,6 +18,11 @@ configcache::configcache(const string& cacheid, const int& nequi, const int& nsk DATADIR = datadir; CACHEID = cacheid; + if ( cacheid.find("_") != -1 ) { + if(log) *log << "CCACHE: Invalid cacheid \"" << cacheid << "\" given. Cacheids must not contain underscores!" << endl << flush; + exit(1); + } + configMem = (char*)malloc(configMemSize); tmpConfig = (char*)malloc(configMemSize); @@ -80,7 +85,7 @@ bool configcache::isValidInFile(const string& infile, infiledesc *filedesc) inchar = new char [infile.size()+1]; strcpy (inchar, infile.c_str()); - + inParts = strtok( inchar, "_" ); for(int iPart=0; inParts!=NULL; iPart++) { @@ -88,8 +93,10 @@ bool configcache::isValidInFile(const string& infile, infiledesc *filedesc) switch(iPart) { - case 1: if(inParts != CACHEID) return false; break; - case 2: + case 1: if(inParts != CACHEID) + return false; + break; + case 2: if (atoi(inParts) > NEQUI) return false; else if (atoi(inParts) < NEQUI)