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
4896df6314
commit
1ff3feb03d
@ -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