Browse Source

mbstowcs() returns the codepoints

master
Arun Prakash Jana 7 years ago
parent
commit
ccdb95f3ab
No known key found for this signature in database GPG Key ID: A75979F35C080412
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      nnn.c

+ 2
- 3
nnn.c View File

@@ -1013,10 +1013,9 @@ xreadline(char *fname)
size_t buflen = NAME_MAX - 1;

DPRINTF_S(fname)
mbstowcs(buf, fname, NAME_MAX);
len = pos = wcslen(buf);
len = pos = mbstowcs(buf, fname, NAME_MAX);
/* For future: handle NULL, say for a new name */
if (len <= 0) {
if (len == (size_t)-1) {
buf[0] = '\0';
len = pos = 0;
}


Loading…
Cancel
Save