diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index a1952e80247..c6048eb5c1a 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -3713,7 +3713,7 @@ static int WCMD_peeknumber(VARSTACK **varstack) { if (!thisvar->isnum) { WCHAR tmpstr[MAXSTRING]; if (GetEnvironmentVariableW(thisvar->variable, tmpstr, MAXSTRING)) { - result = wcstoul(tmpstr,NULL,0); + result = wcstol(tmpstr,NULL,0); } WINE_TRACE("Envvar %s converted to %d\n", wine_dbgstr_w(thisvar->variable), result); } else {