xorg-server-1.20.0/miext/rootless/rootlessGC.c:1238: confused chain of if statements
Submitted by dcb..@..il.com
Assigned to Xorg Project Team
Link to original bug (#106475)
Description
xorg-server-1.20.0/miext/rootless/rootlessGC.c:1238] -> [xorg-server-1.20.0/miext/rootless/rootlessGC.c:1246]: (warning) Identical inner 'if' condition is always true.
Source code is
if (width > 0) {
BoxRec box;
/* ugh */
box.x1 = dst->x + x + FONTMINBOUNDS(pGC->font, leftSideBearing);
box.x2 = dst->x + x + FONTMAXBOUNDS(pGC->font, rightSideBearing);
if (count > 1) {
if (width > 0)
box.x2 += width;
else
box.x1 += width;
box.x1 can never be incremented.