From 7e2defc10d3816eaab14369941a84b68c8d1d2bc Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Fri, 14 Apr 2023 15:24:18 +0200 Subject: macOS: remove calls to deprecated API --- src/Fl_cocoa.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index da3d27116..5db3bae33 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2545,7 +2545,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; else if ( [[pboard types] containsObject:UTF8_pasteboard_type] ) { NSData *data = [pboard dataForType:UTF8_pasteboard_type]; DragData = (char *)malloc([data length] + 1); - [data getBytes:DragData]; + [data getBytes:DragData length:[data length]]; DragData[[data length]] = 0; Fl_Screen_Driver::convert_crlf(DragData, strlen(DragData)); } @@ -3528,7 +3528,7 @@ static int get_plain_text_from_clipboard(int clipboard) free(aux_c); } else { - [data getBytes:fl_selection_buffer[clipboard]]; + [data getBytes:fl_selection_buffer[clipboard] length:[data length]]; } fl_selection_buffer[clipboard][len - 1] = 0; length = Fl_Screen_Driver::convert_crlf(fl_selection_buffer[clipboard], len - 1); // turn all \r characters into \n: -- cgit v1.2.3