Infobar: Fix strncpy mistake.

This commit is contained in:
Martin Duquesnoy 2010-01-10 15:06:37 +01:00
parent af0d459b4c
commit d8afcfa013

View File

@ -194,7 +194,8 @@ infobar_draw_statustext(int sc, char *str)
lastst = infobar[sc].statustext;
infobar[sc].statustext = _strdup(str);
strncpy(strwc, str, sizeof(strwc));
strncpy(strwb, str, sizeof(strwb));
len = ((strlen(str) > sizeof(strwc)) ? sizeof(strwc) : strlen(str));
@ -217,6 +218,8 @@ infobar_draw_statustext(int sc, char *str)
else
strwc[j] = strwb[i];
printf("--> '%s'\n", strwc);
/* Draw a first time the statustext for non colorized text */
draw_text(infobar[sc].bar->dr, (sgeo[sc].width - SHADH) - textw(strwc),
FHINFOBAR, infobar[sc].bar->fg, 0, strwc);