diff --git a/winpr/libwinpr/clipboard/clipboard.c b/winpr/libwinpr/clipboard/clipboard.c index 585c987e0..01a75503b 100644 --- a/winpr/libwinpr/clipboard/clipboard.c +++ b/winpr/libwinpr/clipboard/clipboard.c @@ -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);