mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 14:48:57 +00:00
Return the correct value when dst == NULL and conversion has stopped after
nwc dropping to zero.
This commit is contained in:
parent
a99c936ba3
commit
6740cd8374
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132525
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user