Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2024-08-28 10:27:21 +01:00
16 changed files with 183 additions and 96 deletions

View File

@ -531,9 +531,10 @@ tty_term_create(struct tty *tty, char *name, char **caps, u_int ncaps,
struct options_array_item *a;
union options_value *ov;
u_int i, j;
const char *s, *value;
const char *s, *value, *errstr;
size_t offset, namelen;
char *first;
int n;
log_debug("adding term %s", name);
@ -567,8 +568,13 @@ tty_term_create(struct tty *tty, char *name, char **caps, u_int ncaps,
code->value.string = tty_term_strip(value);
break;
case TTYCODE_NUMBER:
code->type = TTYCODE_NUMBER;
code->value.number = atoi(value);
n = strtonum(value, 0, INT_MAX, &errstr);
if (errstr != NULL)
log_debug("%s: %s", ent->name, errstr);
else {
code->type = TTYCODE_NUMBER;
code->value.number = n;
}
break;
case TTYCODE_FLAG:
code->type = TTYCODE_FLAG;