cmd: Avoid division by zero in set /a with %.

This commit is contained in:
Jason Edmeades 2013-01-06 20:23:53 +00:00 committed by Alexandre Julliard
parent 45eeeb00f3
commit 3735bf6af5

View File

@ -3661,6 +3661,7 @@ static int WCMD_reduce(OPSTACK **opstack, VARSTACK **varstack) {
WCMD_pushnumber(NULL, var2&var1, varstack);
break;
case '%': var2 = WCMD_popnumber(varstack);
if (var1 == 0) return WCMD_DIVIDEBYZERO;
WCMD_pushnumber(NULL, var2%var1, varstack);
break;
case '^': var2 = WCMD_popnumber(varstack);