diff --git a/src/XMLRequest/XMLRequestParser.cc b/src/XMLRequest/XMLRequestParser.cc index ed115da..210492a 100644 --- a/src/XMLRequest/XMLRequestParser.cc +++ b/src/XMLRequest/XMLRequestParser.cc @@ -176,7 +176,12 @@ public: if (lTTIndex) { //Add only interval designate by index - size_t index = atoi( (const char*)lTTIndex ); + int tmpIndex = atoi( (const char*)lTTIndex ); + size_t index; + if(tmpIndex == -1) + index = lTimeIntervalList.size() -1; + else + index = (size_t)tmpIndex; xmlFree(lTTIndex); @@ -262,7 +267,12 @@ public: if (lCatalogIndex) { //Add only interval designate by index - size_t index = atoi( (const char*)lCatalogIndex ); + int tmpIndex = atoi( (const char*)lCatalogIndex ); + size_t index; + if(tmpIndex == -1) + index = lTimeIntervalList.size() -1; + else + index = (size_t)tmpIndex; xmlFree(lCatalogIndex); -- libgit2 0.21.2