aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnselm R.Garbe <arg@10ksloc.org>2006-08-14 10:56:57 +0200
committerAnselm R.Garbe <arg@10ksloc.org>2006-08-14 10:56:57 +0200
commit6a26e97f741d732a68a978bbcde4331a6a1610c2 (patch)
treee7125c6f2e26a4ac56a92bd25a789ad6324ef5a0
parent0e21ef5f3701cafb9936b5fcbfc204bc477cb215 (diff)
fixed string cutting
-rw-r--r--draw.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/draw.c b/draw.c
index 066a0bf..dddede0 100644
--- a/draw.c
+++ b/draw.c
@@ -70,12 +70,12 @@ drawtext(const char *text, Bool invert, Bool border)
70 while(len && (w = textnw(buf, len)) > dc.w - h) 70 while(len && (w = textnw(buf, len)) > dc.w - h)
71 buf[--len] = 0; 71 buf[--len] = 0;
72 if(len < olen) { 72 if(len < olen) {
73 if(len > 1)
74 buf[len - 1] = '.';
75 if(len > 2)
76 buf[len - 2] = '.';
73 if(len > 3) 77 if(len > 3)
74 memcpy(buf + len - 4, "...\0", 4); 78 buf[len - 3] = '.';
75 else if(len > 2)
76 memcpy(buf + len - 3, "..\0", 3);
77 else if(len > 1)
78 memcpy(buf + len - 2, ".\0", 2);
79 } 79 }
80 80
81 if(w > dc.w) 81 if(w > dc.w)