summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--term.c12
-rw-r--r--term_ascii.c4
2 files changed, 5 insertions, 11 deletions
diff --git a/term.c b/term.c
index ecbfdf6a..10516d14 100644
--- a/term.c
+++ b/term.c
@@ -458,9 +458,7 @@ term_word(struct termp *p, const char *word)
if (p->enc == TERMENC_ASCII) {
cp = mchars_spec2str(p->symtab,
seq, sz, &ssz);
- if (cp == NULL)
- encode(p, "<?>", 3);
- else
+ if (cp != NULL)
encode(p, cp, ssz);
} else {
uc = mchars_spec2cp(p->symtab, seq, sz);
@@ -690,14 +688,10 @@ term_strlen(const struct termp *p, const char *cp)
sz += cond_width(p, c, &skip);
break;
case ESCAPE_SPECIAL:
- if (p->enc == TERMENC_ASCII) {
+ if (p->enc == TERMENC_ASCII)
rhs = mchars_spec2str(p->symtab,
seq, ssz, &rsz);
- if (rhs == NULL) {
- rhs = "<?>";
- rsz = 3;
- }
- } else {
+ else {
c = mchars_spec2cp(p->symtab,
seq, ssz);
if (c > 0)
diff --git a/term_ascii.c b/term_ascii.c
index 079df118..9b5921ff 100644
--- a/term_ascii.c
+++ b/term_ascii.c
@@ -19,6 +19,7 @@
#include <sys/types.h>
+#include <assert.h>
#if HAVE_WCHAR
#include <locale.h>
#endif
@@ -337,8 +338,7 @@ ascii_uc2str(int uc)
"j", "DZ", "Dz", "dz", "'\bG", "'\bg", "HV", "W",
"`\bN", "`\bn", "A", "a", "'\bAE","'\bae","O", "o"};
- if (uc < 0)
- return("<?>");
+ assert(uc >= 0);
if ((size_t)uc < sizeof(tab)/sizeof(tab[0]))
return(tab[uc]);
return(mchars_uc2str(uc));