Browse Source

Merge pull request #169 from trapexit/scan-check-cleanup

fix misc issues flagged by clang scan-build
pull/171/head
Antonio SJ Musumeci 9 years ago
parent
commit
762a04242f
  1. 2
      src/fs.cpp
  2. 2
      src/gidcache.cpp
  3. 1
      src/option_parser.cpp

2
src/fs.cpp

@ -104,7 +104,7 @@ namespace fs
vector<string> &strs) vector<string> &strs)
{ {
int flags; int flags;
glob_t gbuf;
glob_t gbuf = {0};
flags = 0; flags = 0;
for(size_t i = 0; i < patterns.size(); i++) for(size_t i = 0; i < patterns.size(); i++)

2
src/gidcache.cpp

@ -110,7 +110,7 @@ gid_t_cache::cache(const uid_t uid,
if(pwdrv != NULL && rv == 0) if(pwdrv != NULL && rv == 0)
{ {
rec->size = 0; rec->size = 0;
rv = ::getgrouplist(pwd.pw_name,gid,NULL,&rec->size);
::getgrouplist(pwd.pw_name,gid,NULL,&rec->size);
rec->size = std::min(MAXGIDS,rec->size); rec->size = std::min(MAXGIDS,rec->size);
rv = ::getgrouplist(pwd.pw_name,gid,rec->gids,&rec->size); rv = ::getgrouplist(pwd.pw_name,gid,rec->gids,&rec->size);
if(rv == -1) if(rv == -1)

1
src/option_parser.cpp

@ -196,7 +196,6 @@ process_opt(Config &config,
int rv; int rv;
std::vector<std::string> argvalue; std::vector<std::string> argvalue;
rv = 1;
str::split(argvalue,arg,'='); str::split(argvalue,arg,'=');
switch(argvalue.size()) switch(argvalue.size())
{ {

Loading…
Cancel
Save