mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 10:43:47 +08:00
fix a memory allocation bug in commit 1e27024d75
This commit is contained in:
parent
41ae7bccc2
commit
f47caefdb9
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 New Issue
Block a user