Skip to content

Commit f5f0cb9

Browse files
committed
Fixed bug in function Utils::explode
1 parent d424a62 commit f5f0cb9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/utils/Utils.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ namespace Utils
5555

5656
for (size_t pos = 0; std::string::npos != pos;)
5757
{
58-
size_t delimiter = str.find(sep, pos);
58+
const size_t delimiter = str.find(sep, pos);
5959

60-
std::string value = str.substr(pos, delimiter);
60+
std::string value = str.substr(pos, delimiter - pos);
6161
trim(value);
6262

6363
values.emplace_back(std::move(value) );
@@ -865,4 +865,4 @@ namespace Utils
865865

866866
return decoded;
867867
}
868-
};
868+
}

src/utils/Utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,4 @@ namespace Utils
137137

138138
std::string urlEncode(const std::string &str);
139139
std::string urlDecode(const std::string &str);
140-
};
140+
}

0 commit comments

Comments
 (0)