From b92d2b00e729c7c0f3038704d9a0e8b0e90652fe Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Wed, 21 Nov 2018 23:53:51 -0500 Subject: [PATCH] handle null path better (should never happen ... chasing down unrelated memory trashing...) --- config.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/config.c b/config.c index 506b842..318256b 100644 --- a/config.c +++ b/config.c @@ -119,8 +119,13 @@ Rect r; r = (**CtrlHand).ctlRect; EraseRect(&r); - SetCtlValue(gstr->length, CtrlHand); - SetCtlTitle(2 + (Pointer)gstr, (Handle)CtrlHand); + if (data) { + SetCtlValue(gstr->length, CtrlHand); + SetCtlTitle(gstr->text, (Handle)CtrlHand); + } else { + SetCtlValue(0, CtrlHand); + SetCtlTitle("", (Handle)CtrlHand); + } } void DoConfig(Word MyID) @@ -143,8 +148,12 @@ Handle newPath = NULL; SetPort(win); // set the current path text... - HLock(rPath); - SetText(win, CtrlPath, *rPath); + if (rPath) { + HLock(rPath); + SetText(win, CtrlPath, *rPath); + } else { + SetText(win, CtrlPath, NULL); + } for (ok = true; ok;) {