The strlen() returns size_t, not int. The fgets() returns
pointer, not int.
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
FILE *fd;
char line[MAX_LENGTH];
int local = 0;
- int len;
+ size_t len;
if(!(fd = fopen(_PATH_PASSWD, "r"))) {
fprintf(stderr,_("Can't read %s, exiting."),_PATH_PASSWD);
}
len = strlen(user);
- while(fgets(line, MAX_LENGTH, fd) > 0) {
+ while(fgets(line, MAX_LENGTH, fd)) {
if(!strncmp(line, user, len) && line[len] == ':') {
local = 1;
break;