[PATCH 08/13] sulogin: use size_t for iterator to avoid cast

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Dave Reisner <dreisner@xxxxxxxxxxxxx>
---
 login-utils/sulogin.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c
index b6cbd05..5894f85 100644
--- a/login-utils/sulogin.c
+++ b/login-utils/sulogin.c
@@ -292,7 +292,7 @@ static char *getpasswd(char *crypted)
 	struct termios old, tty;
 	static char pass[128];
 	char *ret = pass;
-	int i;
+	size_t i;
 
 	if (crypted[0])
 		printf("Give root password for maintenance\n");
@@ -318,7 +318,7 @@ static char *getpasswd(char *crypted)
 	if (read(0, pass, sizeof(pass) - 1) <= 0)
 		ret = NULL;
 	else {
-		for (i = 0; i < (int)sizeof(pass) && pass[i]; i++)
+		for (i = 0; i < sizeof(pass) && pass[i]; i++)
 			if (pass[i] == '\r' || pass[i] == '\n') {
 				pass[i] = 0;
 				break;
-- 
1.7.9.2

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux