Merge pull request #4072 from andrethomas/patch-1

Fix SerialSendRaw() to adjust for whitespace
This commit is contained in:
Theo Arends 2018-10-15 23:21:52 +02:00 committed by GitHub
commit f5eb2919bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -756,6 +756,8 @@ void SerialSendRaw(char *codes, int size)
char stemp[3]; char stemp[3];
uint8_t code; uint8_t code;
size = strlen(codes); // Force size to be strlen of codes, if whitespace was removed it will overrun into unwanted buffer space
while (size > 0) { while (size > 0) {
snprintf(stemp, sizeof(stemp), codes); snprintf(stemp, sizeof(stemp), codes);
code = strtol(stemp, &p, 16); code = strtol(stemp, &p, 16);