Compare commits

...

3 Commits
r2 ... master

Author SHA1 Message Date
Kelvin Sherlock 91f4b65920 version bump. 2021-07-07 18:44:01 -04:00
Kelvin Sherlock 1155573111 buffer allocation was wrong which caused excess allocations
it also may have written past the end of the buffer and lost
characters (including formatting characters, resulting in display glitches).
2021-07-07 18:43:53 -04:00
Kelvin Sherlock 8085d2c934 reset the connection state when opening/closing the window. 2021-07-07 16:50:09 -04:00
2 changed files with 8 additions and 9 deletions

11
nda.c
View File

@ -46,7 +46,6 @@ void NDAResourceShutDown(NDAResourceCookie *cookie);
Word NDAResourceStartUp(Word memID, Word access, NDAResourceCookie *cookie);
Word MyID;
Word ipid;
Word FlagTCP;
Word ToolsLoaded;
GrafPortPtr MyWindow;
@ -107,7 +106,7 @@ void AppendText(word length, char *cp) {
size = TextHandleUsed + length;
if (size > TextHandleSize) {
size += 4095;
size &= ~4096;
size &= ~4095;
if (h) {
HUnlock(h);
@ -154,7 +153,7 @@ void SetText(void) {
longword oldStart, oldEnd;
TESetSelection((Pointer)-1, (Pointer)-1, TECtrlHandle);
TESetText(teDataIsTextBox2|teTextIsPtr, (Ref)*TextHandle, TextHandleUsed, NULL, NULL, TECtrlHandle);
TESetText(teDataIsTextBox2|teTextIsPtr, (Ref)*TextHandle, TextHandleUsed, 0, NULL, TECtrlHandle);
TextHandleUsed = 0;
@ -395,7 +394,6 @@ pascal word HandleRequest(word request, longword dataIn, longword dataOut) {
if (request == TCPIPSaysNetworkDown) {
FlagTCP = false;
ipid = 0;
UpdateStatus(true);
}
SetCurResourceApp(oldRApp);
@ -434,7 +432,6 @@ void NDAInit(Word code) {
ToolsLoaded = false;
MyID = MMStartUp();
ipid = 0;
st = st_none;
} else {
if (ToolsLoaded)
@ -448,6 +445,7 @@ void NDAClose(void) {
AcceptRequests(ReqName, MyID, NULL);
ConnectionAbort(&connection);
st = st_none;
CloseWindow(MyWindow);
MyWindow = NULL;
@ -469,6 +467,7 @@ GrafPortPtr NDAOpen(void) {
TextHandle = NULL;
TextHandleSize = 0;
TextHandleSize = 0;
st = st_none;
if (!ToolsLoaded) {
if (NDAStartUpTools(MyID, &ss)) {
@ -541,7 +540,7 @@ void DoDefine(void) {
handle = (Handle)GetCtlHandleFromID(MyWindow, rCtrlTE);
TESetText(teDataIsTextBlock, (Ref)"", 0, NULL, NULL, handle);
TESetText(teDataIsTextBlock|teTextIsPtr, (Ref)"", 0, 0, NULL, handle);
GetLETextByID(MyWindow, rCtrlLE, (StringPtr)word_to_define);

View File

@ -114,7 +114,7 @@ resource rText (0x4) {
resource rComment (1) {
"Dict NDA\n\n"
"Written by Kelvin W Sherlock\n"
"2018-2019"
"2018-2021"
};
resource rVersion (1) {
@ -123,9 +123,9 @@ resource rVersion (1) {
0,
0,
alpha,
0
1
},
verUS,
"Dict",
"(C) 2018-2019 Kelvin Sherlock "
"(C) 2018-2021 Kelvin Sherlock "
};