From ffc5a3d7550528281976745279e77ac9faba551b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 5 Jun 2021 15:44:37 +0300 Subject: the only valuable idea from mirevents.pas moved into history++ --- plugins/HistoryPlusPlus/hpp_events.pas | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'plugins/HistoryPlusPlus') diff --git a/plugins/HistoryPlusPlus/hpp_events.pas b/plugins/HistoryPlusPlus/hpp_events.pas index c4dde1817d..2f980162f0 100644 --- a/plugins/HistoryPlusPlus/hpp_events.pas +++ b/plugins/HistoryPlusPlus/hpp_events.pas @@ -385,14 +385,21 @@ begin BlobSize := db_event_getBlobSize(hDBEvent); if BlobSize > 0 then begin - EventBuffer.Allocate(BlobSize); + EventBuffer.Allocate(BlobSize+2); // cheat, for possible crash avoid Result.pBlob := EventBuffer.Buffer; end else BlobSize := 0; - Result.cbBlob := BlobSize; + if db_event_get(hDBEvent, @Result) = 0 then - Result.cbBlob := BlobSize + begin + Result.cbBlob := BlobSize; + if BlobSize > 0 then + begin + PAnsiChar(Result.pBlob)[BlobSize ]:=#0; + PAnsiChar(Result.pBlob)[BlobSize+1]:=#0; + end; + end else Result.cbBlob := 0; end; -- cgit v1.2.3