A new bug found with pointer casting in case someone wants a crack at it over the next several days:
http://www.z88dk.org/forum/viewtopic.php?id=9165
"i" starts as an int and when the code casts to char* it looks like the compiler makes it int* instead so that two bytes are written instead of one.
------------------------------------------------------------------------------