forked from github/server
make coverity understand that there is no buffer overflow here.
This commit is contained in:
parent
d6b57fc818
commit
15f2e014d2
|
@ -1514,14 +1514,12 @@ static void handlekey(state * st, int c)
|
||||||
}
|
}
|
||||||
if (wnd == NULL) {
|
if (wnd == NULL) {
|
||||||
static char kbuffer[80];
|
static char kbuffer[80];
|
||||||
if (kbuffer[0] == 0) {
|
if (kbuffer[0] == 0 || strlen(kbuffer) > 70) {
|
||||||
strcpy(kbuffer, "getch:");
|
strcpy(kbuffer, "getch:");
|
||||||
}
|
}
|
||||||
sprintf(sbuffer, " 0x%x", c);
|
snprintf(sbuffer, 10, " 0x%x", c);
|
||||||
strncat(kbuffer, sbuffer, sizeof(kbuffer) - 1);
|
strncat(kbuffer, sbuffer, sizeof(kbuffer) - 1);
|
||||||
statusline(st->wnd_status->handle, kbuffer);
|
statusline(st->wnd_status->handle, kbuffer);
|
||||||
if (strlen(kbuffer) > 70)
|
|
||||||
kbuffer[0] = 0;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue