applied Jukka's sizeof K&R compliance patch, applied Manuels' last-line printage proposal for stdin reading.
This commit is contained in:
parent
27ef73507b
commit
61a1910f91
5 changed files with 16 additions and 14 deletions
4
draw.c
4
draw.c
|
@ -43,8 +43,8 @@ drawtext(const char *text, unsigned long col[ColLast], Bool ldot, Bool rdot) {
|
|||
return;
|
||||
w = 0;
|
||||
olen = len = strlen(text);
|
||||
if(len >= sizeof(buf))
|
||||
len = sizeof(buf) - 1;
|
||||
if(len >= sizeof buf)
|
||||
len = sizeof buf - 1;
|
||||
memcpy(buf, text, len);
|
||||
buf[len] = 0;
|
||||
h = dc.font.ascent + dc.font.descent;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue