summaryrefslogtreecommitdiff
path: root/plugins/HistoryPlusPlus
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-06-05 15:44:37 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-06-05 15:44:37 +0300
commitffc5a3d7550528281976745279e77ac9faba551b (patch)
treee500aeeee7d2dde3ec1e1417925f8fa57d74f3b1 /plugins/HistoryPlusPlus
parentf376864fbf30f106b27f67ff33627dde3530121b (diff)
the only valuable idea from mirevents.pas moved into history++
Diffstat (limited to 'plugins/HistoryPlusPlus')
-rw-r--r--plugins/HistoryPlusPlus/hpp_events.pas13
1 files changed, 10 insertions, 3 deletions
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;