From 489374709c9ebbab8023711f0de449c0951455e0 Mon Sep 17 00:00:00 2001 From: James Youngman Date: Sun, 6 Apr 2008 12:54:44 +0100 Subject: [PATCH] login-utils: cleanup strlen() and fgets() usage The strlen() returns size_t, not int. The fgets() returns pointer, not int. Signed-off-by: James Youngman Signed-off-by: Karel Zak --- login-utils/islocal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/login-utils/islocal.c b/login-utils/islocal.c index 1ee84089..29769804 100644 --- a/login-utils/islocal.c +++ b/login-utils/islocal.c @@ -32,7 +32,7 @@ is_local(char *user) 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); @@ -40,7 +40,7 @@ is_local(char *user) } 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; -- 2.39.5