Commit c05a4c6c authored by ROOL's avatar ROOL 🤖

Correction to Wimp message length

Detail:
  The structure definition includes an initial slot for a type, so the length calculation should subtract 1 when using sizeof().
parent 0857587f
...@@ -563,7 +563,7 @@ static BOOL draw_clipboard_send_datarequest(wimp_eventstr *e) ...@@ -563,7 +563,7 @@ static BOOL draw_clipboard_send_datarequest(wimp_eventstr *e)
int *types; int *types;
memset(&msg, 0, sizeof(wimp_msgstr)); memset(&msg, 0, sizeof(wimp_msgstr));
msg.hdr.size = 20 + (6 * sizeof(int)) + sizeof(wimp_msghdr); msg.hdr.size = sizeof(wimp_msghdr) + sizeof(wimp_msgdatarequest) + (6-1)*sizeof(int);
msg.hdr.action = wimp_MDATAREQUEST; msg.hdr.action = wimp_MDATAREQUEST;
msg.data.datarequest.w = 0; msg.data.datarequest.w = 0;
msg.data.datarequest.h = &clipdata; msg.data.datarequest.h = &clipdata;
......
...@@ -741,7 +741,7 @@ static void draw_drag_dragclaim_send(wimp_eventstr *e) ...@@ -741,7 +741,7 @@ static void draw_drag_dragclaim_send(wimp_eventstr *e)
list[4] = FileType_DataExchangeFormat; list[4] = FileType_DataExchangeFormat;
list[5] = wimp_MDRAGCLAIM_types_end; list[5] = wimp_MDRAGCLAIM_types_end;
msg.hdr.size = sizeof(wimp_msghdr) + 6*sizeof(int) + sizeof(wimp_msgdragclaim); msg.hdr.size = sizeof(wimp_msghdr) + sizeof(wimp_msgdragclaim) + (6-1)*sizeof(int);
wimp_sendmessage (wimp_ESEND, &msg, e->data.msg.hdr.task); wimp_sendmessage (wimp_ESEND, &msg, e->data.msg.hdr.task);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment