fixing sizeof stuff
This commit is contained in:
4
draw.c
4
draw.c
@ -35,8 +35,8 @@ drawtext(const char *text, unsigned long col[ColLast]) {
|
||||
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;
|
||||
|
Reference in New Issue
Block a user