Skip to content

Commit

Permalink
cast to unsigned for comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
zmichaels11 committed Nov 11, 2019
1 parent e7f16cb commit 0b9d5d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/impl/list_ports/list_ports_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ glob(const vector<string>& patterns)

glob_t glob_results;

int glob_retval = glob(patterns[0].c_str(), 0, NULL, &glob_results);
glob(patterns[0].c_str(), 0, NULL, &glob_results);

vector<string>::const_iterator iter = patterns.begin();

while(++iter != patterns.end())
{
glob_retval = glob(iter->c_str(), GLOB_APPEND, NULL, &glob_results);
glob(iter->c_str(), GLOB_APPEND, NULL, &glob_results);
}

for(int path_index = 0; path_index < glob_results.gl_pathc; path_index++)
for(unsigned int path_index = 0; path_index < glob_results.gl_pathc; path_index++)
{
paths_found.push_back(glob_results.gl_pathv[path_index]);
}
Expand Down Expand Up @@ -243,7 +243,7 @@ format(const char* format, ...)
{
done = true;
}
else if( return_value >= buffer_size_bytes )
else if(static_cast<unsigned int>(return_value) >= buffer_size_bytes)
{
// Realloc and try again.

Expand Down

0 comments on commit 0b9d5d5

Please sign in to comment.