| 1 | From c91d7ae5dbb00c8392a9f93283dc56c3e296cccd Mon Sep 17 00:00:00 2001 |
| 2 | From: Petter <petter@mykolab.ch> |
| 3 | Date: Thu, 27 Apr 2017 20:19:21 +0200 |
| 4 | Subject: [PATCH] Fix size of the array passed to memset() |
| 5 | |
| 6 | --- |
| 7 | qmltermwidget/lib/History.cpp | 2 +- |
| 8 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 9 | |
| 10 | diff --git a/qmltermwidget/lib/History.cpp b/qmltermwidget/lib/History.cpp |
| 11 | index 0f9c13f..ab6f7be 100644 |
| 12 | --- a/qmltermwidget/lib/History.cpp |
| 13 | +++ b/qmltermwidget/lib/History.cpp |
| 14 | @@ -515,7 +515,7 @@ void HistoryScrollBlockArray::addCells(const Character a[], int count) |
| 15 | // put cells in block's data |
| 16 | assert((count * sizeof(Character)) < ENTRIES); |
| 17 | |
| 18 | - memset(b->data, 0, ENTRIES); |
| 19 | + memset(b->data, 0, sizeof(b->data)); |
| 20 | |
| 21 | memcpy(b->data, a, count * sizeof(Character)); |
| 22 | b->size = count * sizeof(Character); |
| 23 | -- |
| 24 | 2.12.2 |
| 25 | |