From 76391b70438121603b3a716d5297954f071b5cf7 Mon Sep 17 00:00:00 2001 From: kichik Date: Tue, 19 Apr 2005 19:40:44 +0000 Subject: [PATCH] bug fixes by brainsucker git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3972 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/Math/Source/Math.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Contrib/Math/Source/Math.c b/Contrib/Math/Source/Math.c index 3df695f4..d1795d4a 100644 --- a/Contrib/Math/Source/Math.c +++ b/Contrib/Math/Source/Math.c @@ -761,7 +761,7 @@ void CopyArray(ExpressionItem *&item) void ItemToType(ExpressionItem* &item, int type) { - char *buffer; + char *buffer, *bp; if (item == NULL) return; int itemt = item->type & ITEMTYPE, oldtype = item->type & ITEMSUBTYPE; @@ -781,9 +781,9 @@ void ItemToType(ExpressionItem* &item, int type) *((double *)&(item->param1)) = (double) *((__int64 *)&(item->param1)); else { - buffer = (char*) item->param1; + bp = buffer = (char*) item->param1; StringToItem(buffer, item, STI_FLOAT); - dbgGlobalFree(buffer); + dbgGlobalFree(bp); } break; case ITC_INT: @@ -791,9 +791,9 @@ void ItemToType(ExpressionItem* &item, int type) *((__int64 *)&(item->param1)) = (__int64) *((double *)&(item->param1)); else { - buffer = (char*) item->param1; + bp = buffer = (char*) item->param1; StringToItem(buffer, item, STI_INT); - dbgGlobalFree(buffer); + dbgGlobalFree(bp); } break; case ITC_ARRAY: @@ -1002,7 +1002,7 @@ void RunTree(ExpressionItem *from, ExpressionItem* &result, int options) break; } - __int64 i1, i2, i3, i4; + __int64 i1=0, i2=0, i3=0, i4=0; if (((!item1)||((item1->type & ITEMTYPE)==IT_CONST)) && ((!item2)||((item2->type & ITEMTYPE)==IT_CONST))) { @@ -1098,7 +1098,7 @@ void RunTree(ExpressionItem *from, ExpressionItem* &result, int options) int ir = -666; char *i1 = (item1)?((char*)item1->param1):(NULL); char *i2 = (item2)?((char*)item2->param1):(NULL); - int sc = lstrcmp(i1, i2); + int sc = (i1 && i2)?(lstrcmp(i1, i2)):((i1)?(1):((i2)?(-1):(0))); switch (subtype) {