Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 02-20-2019, 12:32 AM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,369
Default ReaScript: Lua passes incorrect string size to myFunc(char* myName, int myName_sz)

If an extension-provided API function takes a string as input, and if the parameters are defined/documented as "char* myName, int myName_sz", REAPER recognizes these as a pair, and the "int myName_sz" becomes an optional parameter (in Lua and EEL) that REAPER automatically fills with some number -- presumably the size of the string.

However, the number that is passed to the extension differs depending on whether Lua or EEL is used: The Lua number is incorrect, and is always 2 less than the EEl number.

For example, "12345" is passed, Lua will send a size of 4, and EEL will send a size of 6. The EEL size is correct, if the terminating \0 is included.
juliansader is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:34 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.