pinosaur
/
dmenu.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0e21ef5
)
fixed string cutting
author
Anselm R.Garbe
<arg@10ksloc.org>
Mon, 14 Aug 2006 08:56:57 +0000
(10:56 +0200)
committer
Anselm R.Garbe
<arg@10ksloc.org>
Mon, 14 Aug 2006 08:56:57 +0000
(10:56 +0200)
draw.c
patch
|
blob
|
history
diff --git
a/draw.c
b/draw.c
index
066a0bf
..
dddede0
100644
(file)
--- a/
draw.c
+++ b/
draw.c
@@
-70,12
+70,12
@@
drawtext(const char *text, Bool invert, Bool border)
while(len && (w = textnw(buf, len)) > dc.w - h)
buf[--len] = 0;
if(len < olen) {
+ if(len > 1)
+ buf[len - 1] = '.';
+ if(len > 2)
+ buf[len - 2] = '.';
if(len > 3)
- memcpy(buf + len - 4, "...\0", 4);
- else if(len > 2)
- memcpy(buf + len - 3, "..\0", 3);
- else if(len > 1)
- memcpy(buf + len - 2, ".\0", 2);
+ buf[len - 3] = '.';
}
if(w > dc.w)