case '\r':
case '\n':
case '\b':
- case '\177':
button = 0;
break;
default:
- if (!isdigit(button)) return NULL;
+ if (button < '0' || button > '9') return NULL;
button -= '0';
if (button > (w == 2 && h == 2? 3: max(w, h))) return NULL;
}
if (flashy || !shading) {
/* clear all background flags */
- } else if (ui->sel && ui->sel[y*w+x]) {
+ } else if (ui && ui->sel && ui->sel[y*w+x]) {
flags |= HIGH_BG;
} else if (v) {
int size = dsf_size(ds->dsf_scratch, y*w+x);
else if (size > v)
flags |= ERROR_BG;
}
- if (ui->cur_visible && x == ui->cur_x && y == ui->cur_y)
+ if (ui && ui->cur_visible && x == ui->cur_x && y == ui->cur_y)
flags |= CURSOR_SQ;
/*