An automatic variable in a local scope is (conceptionally) destroyed with

the closing brace so it is unwise to keep a pointer to it. Make
the variable static to fix this.

Patch:		7.152

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
This commit is contained in:
harti 2005-03-22 07:56:22 +00:00
parent 874c97e5d4
commit 2cb520d06e

View File

@ -558,7 +558,7 @@ main(int argc, char **argv)
*/
if (!machine) {
#ifndef MACHINE
struct utsname utsname;
static struct utsname utsname;
if (uname(&utsname) == -1)
err(2, "uname");