]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Use ZUSTR2STP() instead of its pattern
authorAlejandro Colomar <alx@kernel.org>
Sun, 30 Jul 2023 16:48:36 +0000 (18:48 +0200)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Fri, 1 Sep 2023 07:39:23 +0000 (09:39 +0200)
Cc: Christian Göttsche <cgzones@googlemail.com>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/utmp.c
src/logoutd.c

index f202abe3248b87f0e9a6edd74686d664f7613ad8..aa837ffb56c2fd1e2e3cf5837866af75b0126495 100644 (file)
@@ -246,7 +246,7 @@ static
        } else if (   (NULL != ut)
                   && ('\0' != ut->ut_host[0])) {
                hostname = XMALLOC(SIZEOF_ARRAY(ut->ut_host) + 1, char);
-               zustr2stp(hostname, ut->ut_host, SIZEOF_ARRAY(ut->ut_host));
+               ZUSTR2STP(hostname, ut->ut_host);
 #endif                         /* HAVE_STRUCT_UTMP_UT_HOST */
        }
 
index 2612a178bb3db42043daf130ca832602ab0869a4..8906ad119d8831bd6dab90f900a7482f50781232 100644 (file)
@@ -46,7 +46,7 @@ static int check_login (const struct utmp *ut)
        char user[sizeof (ut->ut_user) + 1];
        time_t now;
 
-       zustr2stp(user, ut->ut_user, SIZEOF_ARRAY(ut->ut_user));
+       ZUSTR2STP(user, ut->ut_user);
 
        (void) time (&now);
 
@@ -224,7 +224,7 @@ int main (int argc, char **argv)
                                kill (-ut->ut_pid, SIGKILL);
                        }
 
-                       zustr2stp(user, ut->ut_user, SIZEOF_ARRAY(ut->ut_user));
+                       ZUSTR2STP(user, ut->ut_user);
 
                        SYSLOG ((LOG_NOTICE,
                                 "logged off user '%s' on '%s'", user,