]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Use UT_USER in place of hard-coded `->ut_name' here, too.
authorJim Meyering <jim@meyering.net>
Mon, 31 Jan 2000 08:38:07 +0000 (08:38 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 31 Jan 2000 08:38:07 +0000 (08:38 +0000)
src/pinky.c
src/who.c

index 65cec90a4db19ae386a3ae9e9806a4e9dd8948be..42150929d4c7a5b489b0e3c59122d2932785d65d 100644 (file)
@@ -1,5 +1,5 @@
 /* GNU's pinky.
-   Copyright (C) 1992-1997, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1992-1997, 1999, 2000 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -199,15 +199,15 @@ print_entry (const STRUCT_UTMP *utmp_ent)
       last_change = 0;
     }
 
-  printf ("%-8.*s", (int) sizeof (utmp_ent->ut_name), utmp_ent->ut_name);
+  printf ("%-8.*s", (int) sizeof (UT_USER (utmp_ent)), UT_USER (utmp_ent));
 
   if (include_fullname)
     {
       struct passwd *pw;
-      char name[sizeof (utmp_ent->ut_name) + 1];
+      char name[sizeof (UT_USER (utmp_ent)) + 1];
 
-      strncpy (name, utmp_ent->ut_name, sizeof (utmp_ent->ut_name));
-      name[sizeof (utmp_ent->ut_name)] = '\0';
+      strncpy (name, UT_USER (utmp_ent), sizeof (UT_USER (utmp_ent)));
+      name[sizeof (UT_USER (utmp_ent))] = '\0';
       pw = getpwnam (name);
       if (pw == NULL)
        printf (" %19s", "        ???");
@@ -405,7 +405,7 @@ scan_entries (int n, const STRUCT_UTMP *utmp_buf,
 
   while (n--)
     {
-      if (utmp_buf->ut_name[0]
+      if (UT_USER (utmp_buf)[0]
 #ifdef USER_PROCESS
          && utmp_buf->ut_type == USER_PROCESS
 #endif
@@ -416,8 +416,8 @@ scan_entries (int n, const STRUCT_UTMP *utmp_buf,
              int i;
 
              for (i = 0; i < argc_names; i++)
-               if (strncmp (utmp_buf->ut_name, argv_names[i],
-                            sizeof (utmp_buf->ut_name)) == 0)
+               if (strncmp (UT_USER (utmp_buf), argv_names[i],
+                            sizeof (UT_USER (utmp_buf))) == 0)
                  {
                    print_entry (utmp_buf);
                    break;
index 6ab23d284b2e4068e081e60fcf00912c5bd9c7c9..db175a623f9bc21c7914b63560f4caf3cabe74d9 100644 (file)
--- a/src/who.c
+++ b/src/who.c
@@ -1,5 +1,5 @@
 /* GNU's who.
-   Copyright (C) 1992-1999 Free Software Foundation, Inc.
+   Copyright (C) 1992-2000 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -153,7 +153,7 @@ print_entry (const STRUCT_UTMP *utmp_ent)
       last_change = 0;
     }
 
-  printf ("%-8.*s", (int) sizeof (utmp_ent->ut_name), utmp_ent->ut_name);
+  printf ("%-8.*s", (int) sizeof (UT_USER (utmp_ent)), UT_USER (utmp_ent));
   if (include_mesg)
     printf ("  %c  ", mesg);
   printf (" %-8.*s", (int) sizeof (utmp_ent->ut_line), utmp_ent->ut_line);
@@ -219,7 +219,7 @@ list_entries_who (int n, const STRUCT_UTMP *utmp_buf)
   entries = 0;
   while (n--)
     {
-      if (utmp_buf->ut_name[0]
+      if (UT_USER (utmp_buf)[0]
 #ifdef USER_PROCESS
          && utmp_buf->ut_type == USER_PROCESS
 #endif
@@ -261,7 +261,7 @@ scan_entries (int n, const STRUCT_UTMP *utmp_buf)
 
   while (n--)
     {
-      if (utmp_buf->ut_name[0]
+      if (UT_USER (utmp_buf)[0]
 #ifdef USER_PROCESS
          && utmp_buf->ut_type == USER_PROCESS
 #endif
@@ -299,7 +299,7 @@ search_entries (int n, const STRUCT_UTMP *utmp_buf, const char *line)
 {
   while (n--)
     {
-      if (utmp_buf->ut_name[0]
+      if (UT_USER (utmp_buf)[0]
 #ifdef USER_PROCESS
          && utmp_buf->ut_type == USER_PROCESS
 #endif