summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
Diffstat (limited to 'read.c')
-rw-r--r--read.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/read.c b/read.c
index 04925c387253..d2095a244efa 100644
--- a/read.c
+++ b/read.c
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.103 2017/06/27 23:24:19 christos Exp $ */
+/* $NetBSD: read.c,v 1.106 2019/07/23 10:18:52 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: read.c,v 1.103 2017/06/27 23:24:19 christos Exp $");
+__RCSID("$NetBSD: read.c,v 1.106 2019/07/23 10:18:52 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -89,8 +89,7 @@ read_init(EditLine *el)
return -1;
ma = &el->el_read->macros;
- if ((ma->macro = el_malloc(EL_MAXMACRO *
- sizeof(*ma->macro))) == NULL) {
+ if ((ma->macro = el_calloc(EL_MAXMACRO, sizeof(*ma->macro))) == NULL) {
free(el->el_read);
return -1;
}
@@ -335,13 +334,7 @@ read_char(EditLine *el, wchar_t *cp)
goto again;
}
case (size_t)-2:
- /*
- * We don't support other multibyte charsets.
- * The second condition shouldn't happen
- * and is here merely for additional safety.
- */
- if ((el->el_flags & CHARSET_IS_UTF8) == 0 ||
- cbp >= MB_LEN_MAX) {
+ if (cbp >= MB_LEN_MAX) {
errno = EILSEQ;
*cp = L'\0';
return -1;