Skip to content

Commit 701f5c1

Browse files
committed
compatible with cxxopt.
in https://github.com/jarro2783/cxxopts/blob/v3.2.1/include/cxxopts.hpp#L1011-L1018 it checks the (!in), if we read after reaching EOF, the !in will be true which results a incorrect_argument_type exception thrown. we should be very careful to avoid read after reaching eof. Signed-off-by: Xiaoxi Chen <[email protected]>
1 parent 7dda682 commit 701f5c1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class HomeObjectConan(ConanFile):
1111
name = "homeobject"
12-
version = "2.0.1"
12+
version = "2.0.2"
1313
homepage = "https://github.com/eBay/HomeObject"
1414
description = "Blob Store built on HomeReplication"
1515
topics = ("ebay")

src/include/homeobject/homeobject.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ struct device_info_t {
2222
friend std::istream& operator>>(std::istream& input, device_info_t& di) {
2323
std::string i_path, i_type;
2424
std::getline(input, i_path, ':');
25-
std::getline(input, i_type);
25+
if (input.peek() != EOF) {
26+
std::getline(input, i_type);
27+
}
2628
di.path = std::filesystem::canonical(i_path);
2729
if (i_type == "HDD") {
2830
di.type = DevType::HDD;

0 commit comments

Comments
 (0)