]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
mood.c: Silence gcc warning.
authorAndre Noll <maan@systemlinux.org>
Sun, 25 Mar 2012 12:51:25 +0000 (14:51 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 25 Mar 2012 15:12:55 +0000 (17:12 +0200)
The newly released gcc-4.7.0 complains about "m" being used
uninitialized in change_current_mood(). gcc is wrong, but this is
not obvious to see: In change_current_mood(), "m" is only going to
be used if load_mood() returns non-negative. This happens only on
success, when load_mood() returns 1. In this case "m" was previously
set to mlpd.m which was initialized to NULL at the top of load_mood()
and later set to the newly allocated mood structure.

This patch makes it easier for gcc by initializing "m" to NULL
upfront. This causes the warning to go away.


No differences found