LED Matrix and Arduino Due Beta (Array problem)

So I have this odd problem. I have this code and it works on the Arduino Mega2560 but not on the Due Beta. The basic stuff works like writing to the display and scrolling and reading twitter via an Arduino Ethernet Shield. What happens is the scrolling text gets "corrupt". So instead of a nice complete tweet, I get a letter goes by and then another random letter. Its really odd. Now the default msg on boot displays fine but once the array gets updated with a tweet is when this happens. I believe short messages are okay, I will have to double check since most tweets are longer. I just don't get why this works on the Mega.

Here is my code. Some of it is from a forum post for scrolling text and the twitter\parsing is from another example. The rest I wrote and took some from other projects I am working on.

The reason to switch to the Due is for speed, the Mega or Uno are not fast enough to scroll text on 8 8x8 Matrices and be smooth. The Due is perfect except of this bug.

I will be posting a blog post soon about the background of this project.
www.mobilewill.us

Thanks for any help anyone can provide. I am trying to get this to work before my Wedding May 4th. I may switch over to SMS as the source but I don't think the source has anything to do with it. Is the updating of the array.

I think I may have found a possible problem.

I think it has to do with this code

char msg[] = "No Msg...";
int msgsize =  strlen(msg);

How does Arduino\Due handle undefined array sizes? I guess the size is set by the initial values on declaration? Will this array grow or am I writing outside the memory allocated for the initial array? Am I just lucky that it worked on the Uno\Mega?

Yup! That was it!. I set the msg array to 140 which is the max tweet size.

I think it has to do with this code

I think it has to do with the code before or after that. There is nothing wrong with that code.

How does Arduino\Due handle undefined array sizes?

It's not undefined. The compiler counts the number of initializers and sets the array size appropriately.

Will this array grow or am I writing outside the memory allocated for the initial array?

No. The size of the array is fixed. If you try to put more than 9 characters (not counting the terminating NULL) in that array, you will stomp on some other memory.

Am I just lucky that it worked on the Uno\Mega?

You are "lucky" only in that didn't discover that other memory got stomped on. In other words, not "lucky" at all. The code is as incorrect on those devices, too.

Thanks, setting the array to 140 chars worked. I was able to run for hours no problem. This explains a lot even before I would get extra LEDs lite that shouldn't be. I can't believe after this time I didn't notice it. Now just to fix some memory management on the queuelist and I am good to go.