(print_user): Rewrite to avoid warning from GCC 4.1.1 with -Wall.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 12 Sep 2006 23:32:16 +0000 (23:32 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 12 Sep 2006 23:32:16 +0000 (23:32 +0000)
ChangeLog
src/who.c

index 57dc2fa6c2f62b54a162bab2955bafadaf8c9fae..956aab0e1ed1f648392569148d69a201a7414d1e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * src/who.c (print_user): Rewrite to avoid warning from
+       GCC 4.1.1 with -Wall.
+
 2006-09-12  Jim Meyering  <jim@meyering.net>
 
        * tests/mv/atomic: Check for specific strace output, rather than
index 82921b0f59c521107703331a4b53084653987b18..211b08fb7c595c85f638b5c67eabeb2691e86f16 100644 (file)
--- a/src/who.c
+++ b/src/who.c
@@ -414,7 +414,7 @@ print_user (const STRUCT_UTMP *utmp_ent, time_t boottime)
          hostlen = 1;
          hoststr = xrealloc (hoststr, hostlen);
        }
-      stpcpy (hoststr, "");
+      *hoststr = '\0';
     }
 #endif