mirror of
https://github.com/adafruit/Adafruit_GPS.git
synced 2026-07-27 19:57:17 +00:00
Attempt to fix compiler warnings 3
This commit is contained in:
+1
-1
@@ -566,7 +566,7 @@ char *Adafruit_GPS::build(char *nmea, const char *thisSource,
|
||||
addChecksum(nmea); // Successful completion
|
||||
if (!noCRLF) { // Add Carriage Return and Line Feed to comply with NMEA-183
|
||||
size_t len = strlen(nmea);
|
||||
char *newStr = malloc(len + 3); // +2 for \r\n, +1 for null terminator
|
||||
char *newStr = (char *)malloc(len + 3); // +2 for \r\n, +1 for null terminator
|
||||
if (newStr) {
|
||||
strcpy(newStr, nmea); // Copy original string
|
||||
strcat(newStr, "\r\n"); // Append \r\n
|
||||
|
||||
Reference in New Issue
Block a user