mirror of
https://github.com/CamHenlin/MessagesForMacintosh.git
synced 2024-06-14 05:29:30 +00:00
fix clearing out tempOutput in coprocessor, use memcpy vs strncpy for taking the values from the serial port. create new release
This commit is contained in:
parent
a961612de3
commit
cd226cec7f
|
@ -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:");
|
||||
|
|
BIN
dist/MessagesForMacintosh.dsk
vendored
BIN
dist/MessagesForMacintosh.dsk
vendored
Binary file not shown.
BIN
dist/MessagesForMacintosh.zip
vendored
BIN
dist/MessagesForMacintosh.zip
vendored
Binary file not shown.
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user