From 9f7f3b013eedfb17d4bda8f5de5eb7dba37a6c75 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Sun, 12 Jan 2020 07:31:26 -0600 Subject: [PATCH] silence compiler warnings Signed-off-by: Serge Hallyn --- libmisc/btrfs.c | 1 - libmisc/prefix_flag.c | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libmisc/btrfs.c b/libmisc/btrfs.c index cae93476..d23da5eb 100644 --- a/libmisc/btrfs.c +++ b/libmisc/btrfs.c @@ -7,7 +7,6 @@ static bool path_exists(const char *p) { - int ret; struct stat sb; return stat(p, &sb) == 0; diff --git a/libmisc/prefix_flag.c b/libmisc/prefix_flag.c index 4fe6d195..d72f7e39 100644 --- a/libmisc/prefix_flag.c +++ b/libmisc/prefix_flag.c @@ -166,7 +166,7 @@ extern struct group *prefix_getgrnam(const char *name) fg = fopen(group_db_file, "rt"); if(!fg) return NULL; - while(grp = fgetgrent(fg)) { + while((grp = fgetgrent(fg)) != NULL) { if(!strcmp(name, grp->gr_name)) break; } @@ -186,7 +186,7 @@ extern struct group *prefix_getgrgid(gid_t gid) fg = fopen(group_db_file, "rt"); if(!fg) return NULL; - while(grp = fgetgrent(fg)) { + while((grp = fgetgrent(fg)) != NULL) { if(gid == grp->gr_gid) break; } @@ -206,7 +206,7 @@ extern struct passwd *prefix_getpwuid(uid_t uid) fg = fopen(passwd_db_file, "rt"); if(!fg) return NULL; - while(pwd = fgetpwent(fg)) { + while((pwd = fgetpwent(fg)) != NULL) { if(uid == pwd->pw_uid) break; } @@ -226,7 +226,7 @@ extern struct passwd *prefix_getpwnam(const char* name) fg = fopen(passwd_db_file, "rt"); if(!fg) return NULL; - while(pwd = fgetpwent(fg)) { + while((pwd = fgetpwent(fg)) != NULL) { if(!strcmp(name, pwd->pw_name)) break; } @@ -246,7 +246,7 @@ extern struct spwd *prefix_getspnam(const char* name) fg = fopen(spw_db_file, "rt"); if(!fg) return NULL; - while(sp = fgetspent(fg)) { + while((sp = fgetspent(fg)) != NULL) { if(!strcmp(name, sp->sp_namp)) break; }