summaryrefslogtreecommitdiff
path: root/glcdgraphics/font.c
diff options
context:
space:
mode:
Diffstat (limited to 'glcdgraphics/font.c')
-rw-r--r--glcdgraphics/font.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/glcdgraphics/font.c b/glcdgraphics/font.c
index 09d513d..29027d0 100644
--- a/glcdgraphics/font.c
+++ b/glcdgraphics/font.c
@@ -385,12 +385,13 @@ int cFont::Width(const std::string & str, unsigned int len) const
unsigned int symcount=0;
uint32_t c;
- for (i = 0; i < (unsigned int)str.length() && symcount < len; i++)
+ i = 0;
+ while (i < (unsigned int)str.length() && symcount < len)
{
- unsigned int tmp = i;
- encodedCharAdjustCounter(IsUTF8(), str, c, tmp);
+ encodedCharAdjustCounter(IsUTF8(), str, c, i);
symcount++;
sum += Width(c);
+ i++;
}
sum += spaceBetween * (symcount - 1);