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:
Hartmut Brandt 2005-03-22 07:56:22 +00:00
parent 4896df6314
commit 1ff3feb03d

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");