diff options
Diffstat (limited to 'src/libdraw')
-rw-r--r-- | src/libdraw/font.c | 2 | ||||
-rw-r--r-- | src/libdraw/stringwidth.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libdraw/font.c b/src/libdraw/font.c index 6b14d3fc..9feffa42 100644 --- a/src/libdraw/font.c +++ b/src/libdraw/font.c @@ -28,7 +28,7 @@ cachechars(Font *f, char **ss, Rune **rr, ushort *cp, int max, int *wp, char **s } wid = 0; *subfontname = 0; - for(i=0; (*sp || *rp) && i<max; sp+=w, rp+=rw){ + for(i=0; i<max && (*sp || *rp); sp+=w, rp+=rw){ if(ss){ r = *(uchar*)sp; if(r < Runeself) diff --git a/src/libdraw/stringwidth.c b/src/libdraw/stringwidth.c index c4877912..f0d13721 100644 --- a/src/libdraw/stringwidth.c +++ b/src/libdraw/stringwidth.c @@ -25,7 +25,7 @@ _stringnwidth(Font *f, char *s, Rune *r, int len) }else rptr = &r; twid = 0; - while((*s || *r) && len){ + while(len && (*s || *r)){ max = Max; if(len < max) max = len; |