diff --git a/env.c b/env.c index e1ab50bf8..58c64adaa 100644 --- a/env.c +++ b/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,