Add suggested fix
This commit is contained in:
parent
792e13d2b2
commit
605dfc3f2b
|
|
@ -571,7 +571,8 @@ char *Adafruit_GPS::build(char *nmea, const char *thisSource,
|
||||||
if (nmeaWithCRLF) {
|
if (nmeaWithCRLF) {
|
||||||
strcpy(nmeaWithCRLF, nmea); // Copy original string
|
strcpy(nmeaWithCRLF, nmea); // Copy original string
|
||||||
strcat(nmeaWithCRLF, "\r\n"); // Append \r\n
|
strcat(nmeaWithCRLF, "\r\n"); // Append \r\n
|
||||||
return nmeaWithCRLF; // return pointer to finished product
|
strcpy(nmea, nmeaWithCRLF); // Copy back to original buffer
|
||||||
|
free(nmeaWithCRLF); // Free the allocated memory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nmea; // return pointer to finished product
|
return nmea; // return pointer to finished product
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue