]> git.wh0rd.org Git - nano.git/commitdiff
handle wctomb() failure in parse_char() too
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 29 Dec 2004 22:05:02 +0000 (22:05 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Wed, 29 Dec 2004 22:05:02 +0000 (22:05 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2208 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

src/utils.c

index 3a38b264168147784fc50c4672464ab05ff23c6f..4e8c428093518ede31b08fdf284221741dbc98ec 100644 (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