Skip to content

Commit 1458f35

Browse files
authored
Merge pull request #26 from tarcisioe/fix-pointer-to-undefined-variable
Avoid taking a reference to a variable that dies right away.
2 parents a3bf9fd + 8f67788 commit 1458f35

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

hsetroot.c

+7-6
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,14 @@ main(int argc, char **argv)
271271
int noutputs = 0;
272272
XineramaScreenInfo *outputs = NULL;
273273

274+
XineramaScreenInfo fake = {
275+
.x_org = 0,
276+
.y_org = 0,
277+
.width = 0,
278+
.height = 0,
279+
};
280+
274281
if (opt_root) {
275-
XineramaScreenInfo fake = {
276-
.x_org = 0,
277-
.y_org = 0,
278-
.width = 0,
279-
.height = 0,
280-
};
281282
noutputs = 1;
282283
outputs = &fake;
283284
} else {

0 commit comments

Comments
 (0)