Return the correct value when dst == NULL and conversion has stopped after

nwc dropping to zero.
This commit is contained in:
Tim J. Robbins 2004-07-22 02:57:29 +00:00
parent a99c936ba3
commit 6740cd8374
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132525

View File

@ -63,11 +63,11 @@ __wcsnrtombs_std(char * __restrict dst, const wchar_t ** __restrict src,
/* Invalid character - wcrtomb() sets errno. */
return ((size_t)-1);
else if (*s == L'\0')
break;
return (nbytes + nb - 1);
s++;
nbytes += nb;
}
return (nbytes + nb - 1);
return (nbytes);
}
while (len > 0 && nwc-- > 0) {