0001-oksh-Avoid-implicit-parameter-conversion-to-char.patch (1746B)
1 From 537b64d1d0b49c4e74c66e2de98ce2dee51a1905 Mon Sep 17 00:00:00 2001 2 From: Michael Forney <mforney@mforney.org> 3 Date: Thu, 2 Apr 2026 17:24:45 -0700 4 Subject: [PATCH] oksh: Avoid implicit parameter conversion to char * 5 6 kb_entry.seq is always used with string functions, so make it a 7 char * instead. 8 --- 9 emacs.c | 4 ++-- 10 misc.c | 6 +++--- 11 2 files changed, 5 insertions(+), 5 deletions(-) 12 13 diff --git a/emacs.c b/emacs.c 14 index 78ac2e4..b2c7ab2 100644 15 --- a/emacs.c 16 +++ b/emacs.c 17 @@ -78,7 +78,7 @@ typedef enum { 18 /* keybindings */ 19 struct kb_entry { 20 TAILQ_ENTRY(kb_entry) entry; 21 - unsigned char *seq; 22 + char *seq; 23 int len; 24 struct x_ftab *ftab; 25 void *args; 26 @@ -1343,7 +1343,7 @@ kb_add_string(kb_func func, void *args, char *str) 27 count = strlen(str); 28 29 k = alloc(sizeof *k + count + 1, AEDIT); 30 - k->seq = (unsigned char *)(k + 1); 31 + k->seq = (char *)(k + 1); 32 k->len = count; 33 k->ftab = xf; 34 k->args = args ? strdup(args) : NULL; 35 diff --git a/misc.c b/misc.c 36 index 428f183..9696230 100644 37 --- a/misc.c 38 +++ b/misc.c 39 @@ -714,10 +714,10 @@ do_gmatch(const unsigned char *s, const unsigned char *se, 40 } 41 42 static int 43 -posix_cclass(const unsigned char *pattern, int test, const unsigned char **ep) 44 +posix_cclass(const char *pattern, int test, const unsigned char **ep) 45 { 46 const struct cclass *cc; 47 - const unsigned char *colon; 48 + const char *colon; 49 size_t len; 50 int rval = 0; 51 52 @@ -754,7 +754,7 @@ cclass(const unsigned char *p, int sub) 53 if ((p[0] == MAGIC && p[1] == '[' && p[2] == ':') || 54 (p[0] == '[' && p[1] == ':')) { 55 do { 56 - const char *pp = p + (*p == MAGIC) + 2; 57 + const char *pp = (char *)p + (*p == MAGIC) + 2; 58 rv = posix_cclass(pp, sub, &p); 59 switch (rv) { 60 case 1: 61 -- 62 2.49.0 63