Fix off-by-one error resulting in truncated output from wcsndup fallback and halloc_wcsndup

darcs-hash:20060221144642-ac50b-9dcd77238bc4bd740bbda6e15ded793fad44c363.gz
This commit is contained in:
axel 2006-02-22 00:46:42 +10:00
parent 92aa99104a
commit 5aa019a0b5
2 changed files with 2 additions and 2 deletions

View file

@ -88,7 +88,7 @@ wchar_t *halloc_wcsndup( void * context, const wchar_t *in, int c )
{
die_mem();
}
wcslcpy( res, in, c );
wcslcpy( res, in, c+1 );
res[c] = L'\0';
return res;
}

View file

@ -1085,7 +1085,7 @@ wchar_t *wcsndup( const wchar_t *in, int c )
{
die_mem();
}
wcsncpy( res, in, c );
wcsncpy( res, in, c+1 );
res[c] = L'\0';
return res;
}