avoid line buffer overflow
This commit is contained in:
parent
c3fda5ac21
commit
391efe37ed
@ -78,7 +78,10 @@ void protocol_process()
|
|||||||
line[char_counter] = 0; // treminate string
|
line[char_counter] = 0; // treminate string
|
||||||
status_message(protocol_execute_line(line));
|
status_message(protocol_execute_line(line));
|
||||||
char_counter = 0; // reset line buffer index
|
char_counter = 0; // reset line buffer index
|
||||||
} else if (c <= ' ') { // Throw away whitepace and control characters
|
} else if (c <= ' ') {
|
||||||
|
// Throw away whitepace and control characters
|
||||||
|
} else if (char_counter >= LINE_BUFFER_SIZE-1) {
|
||||||
|
// Throw away any characters beyond the end of the line buffer
|
||||||
} else if (c >= 'a' && c <= 'z') { // Upcase lowercase
|
} else if (c >= 'a' && c <= 'z') { // Upcase lowercase
|
||||||
line[char_counter++] = c-'a'+'A';
|
line[char_counter++] = c-'a'+'A';
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user