mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 01:51:14 -03:00
fix a memory allocation bug in commit 1e27024d75
This commit is contained in:
2
env.c
2
env.c
@@ -654,7 +654,7 @@ void env_init()
|
|||||||
{
|
{
|
||||||
wchar_t *nshlvl, **end_nshlvl;
|
wchar_t *nshlvl, **end_nshlvl;
|
||||||
/* add an extra space for digit dump (9+1=10) */
|
/* 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);
|
nshlvl = malloc(i);
|
||||||
end_nshlvl = calloc( 1, sizeof(nshlvl) );
|
end_nshlvl = calloc( 1, sizeof(nshlvl) );
|
||||||
if ( nshlvl && swprintf( nshlvl, i,
|
if ( nshlvl && swprintf( nshlvl, i,
|
||||||
|
|||||||
Reference in New Issue
Block a user