clipboard: fix of by one error on cleanup
This commit is contained in:
parent
28e63786cd
commit
cbbc680131
@ -364,9 +364,9 @@ BOOL ClipboardInitFormats(wClipboard* clipboard)
|
||||
if (!clipboard)
|
||||
return FALSE;
|
||||
|
||||
for (formatId = 0; formatId < CF_MAX; formatId++)
|
||||
for (formatId = 0; formatId < CF_MAX; formatId++, clipboard->numFormats++)
|
||||
{
|
||||
format = &(clipboard->formats[clipboard->numFormats++]);
|
||||
format = &(clipboard->formats[clipboard->numFormats]);
|
||||
ZeroMemory(format, sizeof(wClipboardFormat));
|
||||
|
||||
format->formatId = formatId;
|
||||
@ -375,7 +375,7 @@ BOOL ClipboardInitFormats(wClipboard* clipboard)
|
||||
if (!format->formatName)
|
||||
{
|
||||
int i;
|
||||
for(i = formatId-1; i >= 0; --i)
|
||||
for (i = formatId-1; i >= 0; --i)
|
||||
{
|
||||
format = &(clipboard->formats[--clipboard->numFormats]);
|
||||
free((void *)format->formatName);
|
||||
|
Loading…
Reference in New Issue
Block a user