fix overrun (n essentially ignored) in wcsncmp
bug report and solution by Richard Pennington
This commit is contained in:
parent
6436b371af
commit
054ba18599
1 changed files with 1 additions and 1 deletions
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
int wcsncmp(const wchar_t *l, const wchar_t *r, size_t n)
|
||||
{
|
||||
for (; n && *l==*r && *l && *r; l++, r++);
|
||||
for (; n && *l==*r && *l && *r; n--, l++, r++);
|
||||
return n ? *l - *r : 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue