diff --git a/Str.c b/Str.c index ac6446a..e4c1e69 100644 --- a/Str.c +++ b/Str.c @@ -105,6 +105,7 @@ Strnew_m_charp(const char *p, ...) Strcat_charp(r, p); p = va_arg(ap, char *); } + va_end(ap); return r; } @@ -276,6 +277,7 @@ Strcat_m_charp(Str x, ...) va_start(ap, x); while ((p = va_arg(ap, char *)) != NULL) Strcat_charp_n(x, p, strlen(p)); + va_end(ap); } void diff --git a/main.c b/main.c index 005d9b2..45f5a4b 100644 --- a/main.c +++ b/main.c @@ -1457,7 +1457,8 @@ escKeyProc(int c, int esc, unsigned char *map) esc |= (CurrentKey & ~0xFFFF); } CurrentKey = esc | c; - w3mFuncList[(int)map[c]].func(); + if (map) + w3mFuncList[(int)map[c]].func(); } DEFUN(escmap, ESCMAP, "ESC map") diff --git a/regex.c b/regex.c index 93406e8..15c7b35 100644 --- a/regex.c +++ b/regex.c @@ -747,7 +747,7 @@ lc2c(longchar * x, int len) int i = 0, j = 0; char *r; - while (x[j].type != RE_TYPE_END && j < len) { + while (j < len && x[j].type != RE_TYPE_END) { if (x[j].type == RE_WHICH_RANGE) y[i++] = '-'; #ifdef USE_M17N