bug-coreutils
[Top][All Lists]
Advanced

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

who.c change to avoid GCC 4.1.1 warning


From: Paul Eggert
Subject: who.c change to avoid GCC 4.1.1 warning
Date: Tue, 12 Sep 2006 16:33:55 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

I got this warning on my Debian stable x86 host with GCC 4.1.1:

  who.c: In function 'print_user':
  who.c:417: warning: value computed is not used

and so installed the following:

2006-09-12  Paul Eggert  <address@hidden>

        * src/who.c (print_user): Rewrite to avoid warning from
        GCC 4.1.1 with -Wall.

--- src/who.c   28 Aug 2006 23:29:39 -0000      1.113
+++ src/who.c   12 Sep 2006 23:31:24 -0000
@@ -414,7 +414,7 @@ print_user (const STRUCT_UTMP *utmp_ent,
          hostlen = 1;
          hoststr = xrealloc (hoststr, hostlen);
        }
-      stpcpy (hoststr, "");
+      *hoststr = '\0';
     }
 #endif
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]