From 2850fdeff74a55cccaf22a472c17b8b3dfa6ce8f Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Wed, 27 Mar 2024 13:00:29 -0700 Subject: [PATCH] Attempt to fix compiler warnings 3 --- src/NMEA_build.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NMEA_build.cpp b/src/NMEA_build.cpp index 9a8548f..c7e9fb8 100644 --- a/src/NMEA_build.cpp +++ b/src/NMEA_build.cpp @@ -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