From d2606e64e410514535b7d52f2e8c639d6bfaac25 Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Thu, 17 May 2012 00:25:30 +0200 Subject: [PATCH] bitfields: bugfix for bugfix: forgot one line --- ground/openpilotgcs/src/plugins/uavobjects/uavobjectfield.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/uavobjects/uavobjectfield.cpp b/ground/openpilotgcs/src/plugins/uavobjects/uavobjectfield.cpp index b82602181..5ccd7371f 100644 --- a/ground/openpilotgcs/src/plugins/uavobjects/uavobjectfield.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjects/uavobjectfield.cpp @@ -492,7 +492,7 @@ void UAVObjectField::clear() switch (type) { case BITFIELD: - memset(&data[offset], 0, numBytesPerElement*((quint32)(numElements/8))); + memset(&data[offset], 0, numBytesPerElement*((quint32)(1+(numElements-1)/8))); break; default: memset(&data[offset], 0, numBytesPerElement*numElements);