From 066429b80c8ccb8580d12562b1d6ab962d96a1c3 Mon Sep 17 00:00:00 2001 From: bz Date: Thu, 22 Aug 2019 07:52:06 +0000 Subject: [PATCH] w: initialize save_p to silence 'may be used uninitilized' After r351379 save_p may be used uninitialized. Set it to NULL before first assignment so that a later NULL check will work correctly. Reported by: CI system for gcc platforms MFC after: 1 week X-MFC with: 351379 (karels) --- usr.bin/w/w.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index 1d8faaf9639..9af0f3c3cd5 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -209,6 +209,7 @@ main(int argc, char *argv[]) if (*argv) sel_users = argv; + save_p = NULL; setutxent(); for (nusers = 0; (utmp = getutxent()) != NULL;) { struct addrinfo hints, *res; -- 2.45.2