cfdisk: wctomb() returns -1 on error

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2012-02-01 12:05:31 +01:00
parent 8379e2e0bf
commit 8162b75a35
1 changed files with 1 additions and 1 deletions

View File

@ -485,7 +485,7 @@ get_string(char *str, int len, char *def) {
char s[MB_CUR_MAX + 1];
int sz = wctomb(s, wc);
if (sz + i < len) {
if (sz > 0 && sz + i < len) {
s[sz] = '\0';
mvaddnstr(y, x + cells, s, sz);
if (use_def) {