Fix overflow for signals >= 100.

Thanks to @gzip4 for tracking this down.

Closes #764.
This commit is contained in:
Hisham Muhammad 2018-03-25 15:15:37 -03:00
parent aa3dc634dc
commit dc050e8088

View File

@ -41,10 +41,10 @@ Panel* SignalsPanel_new() {
}
#if (defined(SIGRTMIN) && defined(SIGRTMAX))
if (SIGRTMAX - SIGRTMIN <= 100) {
static char buf[15];
static char buf[16];
for (int sig = SIGRTMIN; sig <= SIGRTMAX; i++, sig++) {
int n = sig - SIGRTMIN;
xSnprintf(buf, 15, "%2d SIGRTMIN%-+3d", sig, n);
xSnprintf(buf, 16, "%2d SIGRTMIN%-+3d", sig, n);
if (n == 0) {
buf[11] = '\0';
}