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:
parent
874c97e5d4
commit
2cb520d06e
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user