forked from pool/pidgin
25 lines
683 B
Diff
25 lines
683 B
Diff
|
http://developer.pidgin.im/ticket/889
|
||
|
|
||
|
I: Program causes undefined operation
|
||
|
(likely same variable used twiceand post/pre incremented in the same expression).
|
||
|
e.g. x = x++; Split it in two operations.
|
||
|
|
||
|
gntwm.c: In function 'dump_screen':
|
||
|
gntwm.c:610: warning: operation on 'fgp' may be undefined
|
||
|
|
||
|
--- finch/libgnt/gntwm.c
|
||
|
+++ finch/libgnt/gntwm.c
|
||
|
@@ -607,7 +607,11 @@
|
||
|
if (bgp == -1)
|
||
|
bgp = COLOR_WHITE;
|
||
|
if (now & A_REVERSE)
|
||
|
- fgp ^= bgp ^= fgp ^= bgp; /* *wink* */
|
||
|
+ {
|
||
|
+ short tgp = bgp;
|
||
|
+ bgp = fgp;
|
||
|
+ fgp = tgp;
|
||
|
+ }
|
||
|
ret = color_content(fgp, &r, &g, &b);
|
||
|
fg.r = r; fg.b = b; fg.g = g;
|
||
|
ret = color_content(bgp, &r, &g, &b);
|