]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sulogin: use size_t for iterator to avoid cast
authorDave Reisner <d@falconindy.com>
Tue, 28 Feb 2012 16:45:16 +0000 (11:45 -0500)
committerKarel Zak <kzak@redhat.com>
Mon, 12 Mar 2012 10:17:36 +0000 (11:17 +0100)
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
login-utils/sulogin.c

index 811018e3b04d288d3e4b09c7dcbf309988797fea..c9e376c43e78a2c32739c06f8f8d7d21adcaa354 100644 (file)
@@ -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;