Skip to content

Commit

Permalink
compatible with cxxopt.
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
xiaoxichen committed Apr 20, 2024
1 parent 7dda682 commit 701f5c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class HomeObjectConan(ConanFile):
name = "homeobject"
version = "2.0.1"
version = "2.0.2"
homepage = "https://github.com/eBay/HomeObject"
description = "Blob Store built on HomeReplication"
topics = ("ebay")
Expand Down
4 changes: 3 additions & 1 deletion src/include/homeobject/homeobject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ struct device_info_t {
friend std::istream& operator>>(std::istream& input, device_info_t& di) {
std::string i_path, i_type;
std::getline(input, i_path, ':');
std::getline(input, i_type);
if (input.peek() != EOF) {
std::getline(input, i_type);
}
di.path = std::filesystem::canonical(i_path);
if (i_type == "HDD") {
di.type = DevType::HDD;
Expand Down

0 comments on commit 701f5c1

Please sign in to comment.