Skip to content

Commit

Permalink
Fix invalid compare
Browse files Browse the repository at this point in the history
The value will never be negative

Signed-off-by: Yadong Qi <yadong.qi@intel.com>
  • Loading branch information
YadongQi authored and sysopenci committed Mar 30, 2023
1 parent e72be90 commit 42bba31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/guest/tui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ void CivTui::SetConfToPtree() {
std::string passthrough;
for (std::vector<std::string>::iterator iter = pt_pci_disp_.begin(); iter != pt_pci_disp_.end(); iter++) {
std::string selectItem = *iter;
if (selectItem.length() < 0)
if (selectItem.length() == 0)
continue;
size_t pos = selectItem.find(" ");
if (pos < 0)
if (pos == std::string::npos)
continue;
passthrough += selectItem.substr(0, pos);
if (iter != (pt_pci_disp_.end() - 1)) {
Expand Down

0 comments on commit 42bba31

Please sign in to comment.