mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
fix a memory allocation bug in commit 1e27024d75
This commit is contained in:
parent
41ae7bccc2
commit
f47caefdb9
1 changed files with 1 additions and 1 deletions
2
env.c
2
env.c
|
@ -654,7 +654,7 @@ void env_init()
|
|||
{
|
||||
wchar_t *nshlvl, **end_nshlvl;
|
||||
/* add an extra space for digit dump (9+1=10) */
|
||||
size_t i = wcslen( shlvl ) + 2;
|
||||
size_t i = wcslen( shlvl ) + 2 * sizeof(wchar_t);
|
||||
nshlvl = malloc(i);
|
||||
end_nshlvl = calloc( 1, sizeof(nshlvl) );
|
||||
if ( nshlvl && swprintf( nshlvl, i,
|
||||
|
|
Loading…
Reference in a new issue