diff --git a/src/Fl_mac.cxx b/src/Fl_mac.cxx index 7c4689250..dc35f3f93 100644 --- a/src/Fl_mac.cxx +++ b/src/Fl_mac.cxx @@ -2580,9 +2580,9 @@ void Fl::paste(Fl_Widget &receiver, int clipboard) { fl_selection_length[1] = 0; #ifdef USE_PASTEBOARD OSStatus err = noErr; - Boolean found=false; - CFDataRef flavorData; - CFStringEncoding encoding=0; + Boolean found = false; + CFDataRef flavorData = NULL; + CFStringEncoding encoding = 0; allocatePasteboard(); PasteboardSynchronize(myPasteboard); @@ -2590,9 +2590,8 @@ void Fl::paste(Fl_Widget &receiver, int clipboard) { err = PasteboardGetItemCount(myPasteboard, &nFlavor); if (err==noErr) { for (i=1; i<=nFlavor; i++) { - PasteboardItemID itemID; - CFArrayRef flavorTypeArray; - CFIndex flavorCount; + PasteboardItemID itemID = 0; + CFArrayRef flavorTypeArray = NULL; found = false; err = PasteboardGetItemIdentifier(myPasteboard, i, &itemID); if (err!=noErr) continue; @@ -2601,18 +2600,19 @@ void Fl::paste(Fl_Widget &receiver, int clipboard) { if (flavorTypeArray) {CFRelease (flavorTypeArray); flavorTypeArray = NULL;} continue; } - flavorCount = CFArrayGetCount(flavorTypeArray); + CFIndex flavorCount = CFArrayGetCount(flavorTypeArray); for (j = 0; j < handledFlavorsCount; j++) { for (CFIndex flavorIndex=0; flavorIndex= fl_selection_buffer_length[1] ) {