handle wctomb() failure in parse_char() too

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2208 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
David Lawrence Ramsey 2004-12-29 22:05:02 +00:00
parent f282428a42
commit 0d847aadd9

View File

@ -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