Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2025-07-19 22:01:08 +01:00
2 changed files with 13 additions and 10 deletions

View File

@ -32,7 +32,7 @@
static int yylex(void);
static int yyparse(void);
static int printflike(1,2) yyerror(const char *, ...);
static void printflike(1,2) yyerror(const char *, ...);
static char *yylex_token(int);
static char *yylex_format(void);
@ -1127,7 +1127,7 @@ cmd_parse_from_arguments(struct args_value *values, u_int count,
return (&pr);
}
static int printflike(1, 2)
static void printflike(1, 2)
yyerror(const char *fmt, ...)
{
struct cmd_parse_state *ps = &parse_state;
@ -1136,7 +1136,7 @@ yyerror(const char *fmt, ...)
char *error;
if (ps->error != NULL)
return (0);
return;
va_start(ap, fmt);
xvasprintf(&error, fmt, ap);
@ -1144,7 +1144,6 @@ yyerror(const char *fmt, ...)
ps->error = cmd_parse_get_error(pi->file, pi->line, error);
free(error);
return (0);
}
static int

View File

@ -1422,14 +1422,16 @@ tty_keys_device_attributes(struct tty *tty, const char *buf, size_t len,
return (1);
/* Copy the rest up to a c. */
for (i = 0; i < (sizeof tmp); i++) {
for (i = 0; i < sizeof tmp; i++) {
if (3 + i == len)
return (1);
if (buf[3 + i] == 'c')
if (buf[3 + i] >= 'a' && buf[3 + i] <= 'z')
break;
tmp[i] = buf[3 + i];
}
if (i == (sizeof tmp))
if (i == sizeof tmp)
return (-1);
if (buf[3 + i] != 'c')
return (-1);
tmp[i] = '\0';
*size = 4 + i;
@ -1504,14 +1506,16 @@ tty_keys_device_attributes2(struct tty *tty, const char *buf, size_t len,
return (1);
/* Copy the rest up to a c. */
for (i = 0; i < (sizeof tmp); i++) {
for (i = 0; i < sizeof tmp; i++) {
if (3 + i == len)
return (1);
if (buf[3 + i] == 'c')
if (buf[3 + i] >= 'a' && buf[3 + i] <= 'z')
break;
tmp[i] = buf[3 + i];
}
if (i == (sizeof tmp))
if (i == sizeof tmp)
return (-1);
if (buf[3 + i] != 'c')
return (-1);
tmp[i] = '\0';
*size = 4 + i;