From 5ba69db3f2d8f5e30d38830366949efcdc5ccef0 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Thu, 18 Apr 2019 23:20:51 -0500 Subject: [PATCH] Fix issues resulting in memory trashing if over ~2500 entries were loaded. This resulted from indexing off a pointer with signed int index values, which in some cases causes ORCA/C to generate code that only works within 32k bytes of the pointer base. The fix is to use unsigned index values, which results in indexing working correctly up to 64k bytes. --- browserwindow.c | 2 +- disksearch.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/browserwindow.c b/browserwindow.c index 39fbfa9..61241f2 100644 --- a/browserwindow.c +++ b/browserwindow.c @@ -215,7 +215,7 @@ void UpdateControlState(void) { } /* Only allow "Mount Disk" to be clicked if there is a disk selected */ - int currentSelection = NextMember2(0, (Handle)disksListHandle); + unsigned currentSelection = NextMember2(0, (Handle)disksListHandle); if (currentSelection != 0) { if (diskList[currentSelection-1].memPtr == moreResultsString) { if (!moreResultsSelected) { diff --git a/disksearch.c b/disksearch.c index 6231607..b465e3b 100644 --- a/disksearch.c +++ b/disksearch.c @@ -30,7 +30,7 @@ static Rect diskListRect = {45, 10, 147, 386}; /* Current length in disk list */ -static int diskListLength = 0; +static unsigned diskListLength = 0; /* Number of current page of results from server */ int pageNum; @@ -50,7 +50,7 @@ void DoSearch(boolean getMore) { char *searchURL = NULL; enum NetDiskError result = 0; - int initialDiskListLength = diskListLength; + unsigned initialDiskListLength = diskListLength; WaitCursor();