From 48ca1177f4e1de1660afa0d9ea64300aa904593d Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Tue, 15 Mar 2022 17:31:49 +1300 Subject: [PATCH] c++ min() wants args of the same type (https://en.cppreference.com/w/cpp/algorithm/min). This allows us to compile with -fno-permissive (gcc default). --- src/NMEA_parse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NMEA_parse.cpp b/src/NMEA_parse.cpp index ddf59eb..d59f5f8 100644 --- a/src/NMEA_parse.cpp +++ b/src/NMEA_parse.cpp @@ -751,13 +751,13 @@ char *Adafruit_GPS::parseStr(char *buff, char *p, int n) { char *e = strchr(p, ','); int len = 0; if (e) { - len = min(e - p, n - 1); + len = min(int(e - p), n - 1); strncpy(buff, p, len); // copy up to the comma buff[len] = 0; } else { e = strchr(p, '*'); if (e) { - len = min(e - p, n - 1); + len = min(int(e - p), n - 1); strncpy(buff, p, len); // or up to the * buff[e - p] = 0; } else {