Skip to content

Commit

Permalink
Add suggested fix
Browse files Browse the repository at this point in the history
  • Loading branch information
makermelissa committed Apr 1, 2024
1 parent 792e13d commit 605dfc3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/NMEA_build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,8 @@ char *Adafruit_GPS::build(char *nmea, const char *thisSource,
if (nmeaWithCRLF) {
strcpy(nmeaWithCRLF, nmea); // Copy original string
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
Expand Down

0 comments on commit 605dfc3

Please sign in to comment.