mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-11 15:37:24 +00:00
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:
parent
92aa99104a
commit
5aa019a0b5
2 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
2
wutil.c
2
wutil.c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue