--- mstools/samples/console/readout.c 2018/08/09 18:21:19 1.1.1.2 +++ mstools/samples/console/readout.c 2018/08/09 18:23:15 1.1.1.3 @@ -1,11 +1,19 @@ + +/******************************************************************************\ +* This is a part of the Microsoft Source Code Samples. +* Copyright (C) 1993 Microsoft Corporation. +* All rights reserved. +* This source code is only intended as a supplement to +* Microsoft Development Tools and/or WinHelp documentation. +* See these sources for detailed information regarding the +* Microsoft samples programs. +\******************************************************************************/ + #include #include #include #include "console.h" -/* Microsoft Developer Support - Copyright (c) 1992 Microsoft Corporation */ - /******************************************************************** * FUNCTION: invertRectangle(HANDLE hConOut, COORD coordStart, * * COORD coordCur) * @@ -39,7 +47,7 @@ void invertRectangle(HANDLE hConOut, COO /* get the width of the selected area */ dwBoxWidth = right - left + 1; /* allocate a buffer for the attributes read from the console */ - awLineAttr = (PWORD) malloc(getConX(hConOut)); + awLineAttr = (PWORD) malloc(getConX(hConOut) * sizeof(DWORD)); PERR(awLineAttr, "malloc"); /* for each line in the selected area */ while (coordStart.Y <= coordCur.Y)