diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/awk.c | 6 | ||||
-rw-r--r-- | editors/sed.c | 6 | ||||
-rw-r--r-- | editors/vi.c | 4 |
3 files changed, 10 insertions, 6 deletions
diff --git a/editors/awk.c b/editors/awk.c index f04ea5ced..fef3246b8 100644 --- a/editors/awk.c +++ b/editors/awk.c | |||
@@ -676,7 +676,7 @@ static char nextchar(char **s) | |||
676 | return c; | 676 | return c; |
677 | } | 677 | } |
678 | 678 | ||
679 | static int ALWAYS_INLINE isalnum_(int c) | 679 | static ALWAYS_INLINE int isalnum_(int c) |
680 | { | 680 | { |
681 | return (isalnum(c) || c == '_'); | 681 | return (isalnum(c) || c == '_'); |
682 | } | 682 | } |
@@ -1682,7 +1682,7 @@ static void hashwalk_init(var *v, xhash *array) | |||
1682 | { | 1682 | { |
1683 | char **w; | 1683 | char **w; |
1684 | hash_item *hi; | 1684 | hash_item *hi; |
1685 | int i; | 1685 | unsigned i; |
1686 | 1686 | ||
1687 | if (v->type & VF_WALK) | 1687 | if (v->type & VF_WALK) |
1688 | free(v->x.walker); | 1688 | free(v->x.walker); |
@@ -1996,7 +1996,7 @@ static var *exec_builtin(node *op, var *res) | |||
1996 | } | 1996 | } |
1997 | 1997 | ||
1998 | nargs = i; | 1998 | nargs = i; |
1999 | if (nargs < (info >> 30)) | 1999 | if ((uint32_t)nargs < (info >> 30)) |
2000 | syntax_error(EMSG_TOO_FEW_ARGS); | 2000 | syntax_error(EMSG_TOO_FEW_ARGS); |
2001 | 2001 | ||
2002 | switch (info & OPNMASK) { | 2002 | switch (info & OPNMASK) { |
diff --git a/editors/sed.c b/editors/sed.c index f85884534..817840dc0 100644 --- a/editors/sed.c +++ b/editors/sed.c | |||
@@ -628,7 +628,7 @@ static int do_subst_command(sed_cmd_t *sed_cmd, char **line) | |||
628 | { | 628 | { |
629 | char *oldline = *line; | 629 | char *oldline = *line; |
630 | int altered = 0; | 630 | int altered = 0; |
631 | int match_count = 0; | 631 | unsigned match_count = 0; |
632 | regex_t *current_regex; | 632 | regex_t *current_regex; |
633 | 633 | ||
634 | /* Handle empty regex. */ | 634 | /* Handle empty regex. */ |
@@ -665,7 +665,9 @@ static int do_subst_command(sed_cmd_t *sed_cmd, char **line) | |||
665 | 665 | ||
666 | /* If we aren't interested in this match, output old line to | 666 | /* If we aren't interested in this match, output old line to |
667 | end of match and continue */ | 667 | end of match and continue */ |
668 | if (sed_cmd->which_match && sed_cmd->which_match != match_count) { | 668 | if (sed_cmd->which_match |
669 | && (sed_cmd->which_match != match_count) | ||
670 | ) { | ||
669 | for (i = 0; i < G.regmatch[0].rm_eo; i++) | 671 | for (i = 0; i < G.regmatch[0].rm_eo; i++) |
670 | pipe_putc(*oldline++); | 672 | pipe_putc(*oldline++); |
671 | continue; | 673 | continue; |
diff --git a/editors/vi.c b/editors/vi.c index 4e5a5ac4a..5013d0d51 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -2239,7 +2239,9 @@ static char readit(void) // read (maybe cursor) key from stdin | |||
2239 | pfd[0].events = POLLIN; | 2239 | pfd[0].events = POLLIN; |
2240 | // keep reading while there are input chars, and room in buffer | 2240 | // keep reading while there are input chars, and room in buffer |
2241 | // for a complete ESC sequence (assuming 8 chars is enough) | 2241 | // for a complete ESC sequence (assuming 8 chars is enough) |
2242 | while (safe_poll(pfd, 1, 0) > 0 && n <= (sizeof(readbuffer) - 8)) { | 2242 | while ((safe_poll(pfd, 1, 0) > 0) |
2243 | && ((size_t)n <= (sizeof(readbuffer) - 8)) | ||
2244 | ) { | ||
2243 | // read the rest of the ESC string | 2245 | // read the rest of the ESC string |
2244 | int r = safe_read(0, readbuffer + n, sizeof(readbuffer) - n); | 2246 | int r = safe_read(0, readbuffer + n, sizeof(readbuffer) - n); |
2245 | if (r > 0) | 2247 | if (r > 0) |