Well, it is amazing how a fresh look at things may solve an issue.
It was the second example as I expected it should be
int nRGBCur = *(datasrc+i);
*(datadest++) = *(datag+nRGBCur);
The issue was option base one rather than zero, which made the size of the array one too large. Amazing what happens when one marches off the end of an array by one byte!!
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Sun 2018.10.07
Well, it is amazing how a fresh look at things may solve an issue.
It was the second example as I expected it should be
The issue was option base one rather than zero, which made the size of the array one too large. Amazing what happens when one marches off the end of an array by one byte!!