diff --git a/coprocessorjs.c b/coprocessorjs.c index b2b5443..56cb380 100644 --- a/coprocessorjs.c +++ b/coprocessorjs.c @@ -225,6 +225,7 @@ void readSerialPort(char* output) { // make sure output variable is clear memset(output, '\0', MAX_RECEIVE_SIZE); + memset(tempOutput, '\0', MAX_RECEIVE_SIZE); bool done = false; long int totalByteCount = 0; @@ -326,7 +327,7 @@ void readSerialPort(char* output) { #ifdef DEBUGGING - writeSerialPortDebug(boutRefNum, "done building temp output\n"); + writeSerialPortDebug(boutRefNum, "done building temp output"); writeSerialPortDebug(boutRefNum, tempOutput); // char debugOutput[255]; @@ -343,7 +344,7 @@ void readSerialPort(char* output) { } // attach the gathered up output from the buffer to the output variable - strncat(output, tempOutput, totalByteCount); + memcpy(output, tempOutput, totalByteCount); #ifdef DEBUGGING writeSerialPortDebug(boutRefNum, "coprocessor.readSerialPort complete, output:"); diff --git a/dist/MessagesForMacintosh.dsk b/dist/MessagesForMacintosh.dsk index 46da517..5617c60 100644 Binary files a/dist/MessagesForMacintosh.dsk and b/dist/MessagesForMacintosh.dsk differ diff --git a/dist/MessagesForMacintosh.zip b/dist/MessagesForMacintosh.zip index ebd5f3d..433764a 100644 Binary files a/dist/MessagesForMacintosh.zip and b/dist/MessagesForMacintosh.zip differ diff --git a/nuklear_app.c b/nuklear_app.c index c708930..c17633d 100644 --- a/nuklear_app.c +++ b/nuklear_app.c @@ -17,6 +17,10 @@ // based on https://github.com/mr21/strsplit.c/blob/master/strsplit.c static char** _strsplit( const char* s, const char* delim, int* nb ) { + + #ifdef DEBUG_FUNCTION_CALLS + writeSerialPortDebug(boutRefNum, "DEBUG_FUNCTION_CALLS: _strsplit"); + #endif void* data; char* _s = ( char* )s; const char** ptrs;