Skip to content
This repository was archived by the owner on Apr 5, 2025. It is now read-only.

Commit a5d594f

Browse files
committed
Fix parsing of parameters closes #43
1 parent 4ce4ca4 commit a5d594f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/util.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,13 +1001,13 @@ static void util_parms_next(std::string &parmline, size_t indxnm_st, size_t indx
10011001
indxcm = parmline.find(",", indxvl_en);
10021002

10031003
if (indxnm_st == 0) {
1004-
if ((indxcm + 1) > parmline.length() ) {
1004+
if (indxcm == std::string::npos) {
10051005
parmline = "";
10061006
} else {
10071007
parmline = parmline.substr(indxcm + 1);
10081008
}
10091009
} else {
1010-
if ((indxcm + 1) > parmline.length() ) {
1010+
if (indxcm == std::string::npos) {
10111011
parmline = parmline.substr(0, indxnm_st - 1);
10121012
} else {
10131013
parmline = parmline.substr(0, indxnm_st - 1) + parmline.substr(indxcm + 1);
@@ -1067,7 +1067,7 @@ void util_parms_parse_qte(ctx_params *params, std::string &parmline)
10671067
indxvl_st = parmline.find("\"",indxeq + 1);
10681068
indxcm = parmline.find(",", indxeq + 1);
10691069
if (indxcm == std::string::npos) {
1070-
if (indxnm_st == std::string::npos) {
1070+
if (indxvl_st == std::string::npos) {
10711071
indxvl_st = indxeq + 1;
10721072
if (indxvl_st >= parmline.length()) {
10731073
indxvl_st = parmline.length() - 1;

0 commit comments

Comments
 (0)