1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-02-02 14:15:46 +01:00

WINGs: simplify code

It looks like the original code was expecting the side effect of specifying
a length in the %d to smartly truncate the number, which it does not.
The new code has the same behaviour without extra complexity.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2019-02-22 15:48:17 +01:00
committed by Carlos R. Mafra
parent 070f0ad8f4
commit 8606ae9a83

View File

@@ -181,10 +181,7 @@ static void drawRulerOnPixmap(Ruler * rPtr)
XDrawLine(rPtr->view->screen->display, rPtr->drawBuffer,
rPtr->fgGC, rPtr->margins.left + m, 23, rPtr->margins.left + m, marks[i % 8] + 23);
if (i != 0 && i % 8 == 0) {
if (j < 10)
snprintf(c, 3, "%d", ++j);
else
snprintf(c, 3, "%2d", ++j);
snprintf(c, sizeof(c), "%d", ++j);
WMDrawString(rPtr->view->screen, rPtr->drawBuffer, rPtr->fg,
rPtr->font, rPtr->margins.left + 2 + m, 26, c, 2);
}