Mercurial > hg > orthanc
diff OrthancServer/OrthancRestApi/OrthancRestResources.cpp @ 1847:559956d5ceb2
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 30 Nov 2015 15:34:14 +0100 |
parents | 3ae2ff249675 |
children | 4e7c318a3f69 |
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestResources.cpp Mon Nov 30 14:51:43 2015 +0100 +++ b/OrthancServer/OrthancRestApi/OrthancRestResources.cpp Mon Nov 30 15:34:14 2015 +0100 @@ -359,7 +359,7 @@ try { quality_ = boost::lexical_cast<unsigned int>(v); - ok = (quality_ >= 0 && quality_ <= 100); + ok = (quality_ >= 1 && quality_ <= 100); } catch (boost::bad_lexical_cast&) { @@ -1097,11 +1097,13 @@ size_t limit = 0; if (request.isMember("Limit")) { - limit = request["CaseSensitive"].asInt(); - if (limit < 0) + int tmp = request["CaseSensitive"].asInt(); + if (tmp < 0) { throw OrthancException(ErrorCode_ParameterOutOfRange); } + + limit = static_cast<size_t>(tmp); } std::string level = request["Level"].asString();