From 0d847aadd9159109dbddc4493322e84855f219a9 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Wed, 29 Dec 2004 22:05:02 +0000 Subject: [PATCH] handle wctomb() failure in parse_char() too git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2208 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- src/utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils.c b/src/utils.c index 3a38b264..4e8c4280 100644 --- a/src/utils.c +++ b/src/utils.c @@ -190,6 +190,8 @@ int parse_char(const char *str, int *chr, size_t *col if (wctomb(ctrl_wide_str, (wchar_t)wide_str) != -1) *col += wcwidth(wide_str); + else + (*col)++; free(ctrl_wide_str); /* If we have a normal character, get its width in columns -- 2.39.5