bug in buffer growth algorithm.

This commit is contained in:
Kelvin Sherlock 2019-07-13 14:22:35 -04:00
parent 41674ac33d
commit eb69b619c9

3
nda.c
View File

@ -107,7 +107,7 @@ void AppendText(word length, char *cp) {
size = TextHandleUsed + length; size = TextHandleUsed + length;
if (size > TextHandleSize) { if (size > TextHandleSize) {
size += 4095; size += 4095;
size &= 4096; size &= ~4096;
if (h) { if (h) {
HUnlock(h); HUnlock(h);
@ -120,7 +120,6 @@ void AppendText(word length, char *cp) {
if (_toolErr) return; if (_toolErr) return;
TextHandleSize = size; TextHandleSize = size;
} }
HLock(h);
} }
BlockMove(cp, *h + TextHandleUsed, length); BlockMove(cp, *h + TextHandleUsed, length);
TextHandleUsed += length; TextHandleUsed += length;