From 84c4fc40f873b56c5dc071b8d6f75f923623a193 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Fri, 27 Mar 2020 12:45:31 +0100 Subject: [PATCH] Fix bug introduced in 9096f70 --- PixelAttributes.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PixelAttributes.cpp b/PixelAttributes.cpp index b67f3fd..5fba147 100644 --- a/PixelAttributes.cpp +++ b/PixelAttributes.cpp @@ -8,8 +8,7 @@ */ #include "PixelAttributes.h" - -using namespace std; +#include PixelAttributes::PixelAttributes(): m_width(0) @@ -35,9 +34,10 @@ void PixelAttributes::setWidth(int width) void PixelAttributes::scroll() { - *m_pixelAttributes[FirstLine] = *m_pixelAttributes[LastLine]; + size_t lineLength = m_width * sizeof(PixelAttribute); + memcpy(m_pixelAttributes[FirstLine], m_pixelAttributes[LastLine], lineLength); for (size_t i = 1; i < LineCount - 1; ++i) { - *m_pixelAttributes[i] = *m_pixelAttributes[EmptyLine]; + memcpy(m_pixelAttributes[i], m_pixelAttributes[EmptyLine], lineLength); } }