1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-02-24 11:15:51 +01:00

fixed a test condition

This commit is contained in:
dan
2003-08-14 01:43:07 +00:00
parent 08225948bc
commit 090cc27f00

View File

@@ -57,9 +57,9 @@ wmbsnrtowcs(wchar_t *dest, const char **src, size_t nbytes, size_t len)
if (dest == NULL) { if (dest == NULL) {
for (;;) { for (;;) {
nb = mbrtowc(NULL, ptr, nbytes, &ps); nb = mbrtowc(NULL, ptr, nbytes, &ps);
if (nb < 0) { if (nb == -1) {
return ((size_t)-1); return ((size_t)-1);
} else if (nb==0 || nb>nbytes) { } else if (nb==0 || nb==-2) {
return n; return n;
} }
ptr += nb; ptr += nb;