mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-19 10:45:12 +00:00
Merge pull request #69 from andrewgaul/always-true
Address clang always true warnings
This commit is contained in:
commit
ed8f424c1a
@ -3165,7 +3165,7 @@ static int read_passwd_file(void)
|
||||
size_t first_pos = string::npos;
|
||||
size_t last_pos = string::npos;
|
||||
bool default_found = 0;
|
||||
bool aws_format;
|
||||
int aws_format;
|
||||
|
||||
// if you got here, the password file
|
||||
// exists and is readable by the
|
||||
|
@ -486,11 +486,13 @@ string get_username(uid_t uid)
|
||||
|
||||
// make buffer
|
||||
if(0 == maxlen){
|
||||
if(0 > (maxlen = (size_t)sysconf(_SC_GETPW_R_SIZE_MAX))){
|
||||
long res = sysconf(_SC_GETPW_R_SIZE_MAX);
|
||||
if(0 > res){
|
||||
DPRNNN("could not get max pw length.");
|
||||
maxlen = 0;
|
||||
return string("");
|
||||
}
|
||||
maxlen = res;
|
||||
}
|
||||
if(NULL == (pbuf = (char*)malloc(sizeof(char) * maxlen))){
|
||||
DPRNCRIT("failed to allocate memory.");
|
||||
@ -522,11 +524,13 @@ int is_uid_inculde_group(uid_t uid, gid_t gid)
|
||||
|
||||
// make buffer
|
||||
if(0 == maxlen){
|
||||
if(0 > (maxlen = (size_t)sysconf(_SC_GETGR_R_SIZE_MAX))){
|
||||
long res = sysconf(_SC_GETGR_R_SIZE_MAX);
|
||||
if(0 > res){
|
||||
DPRNNN("could not get max name length.");
|
||||
maxlen = 0;
|
||||
return -ERANGE;
|
||||
}
|
||||
maxlen = res;
|
||||
}
|
||||
if(NULL == (pbuf = (char*)malloc(sizeof(char) * maxlen))){
|
||||
DPRNCRIT("failed to allocate memory.");
|
||||
|
Loading…
Reference in New Issue
Block a user