Bugfix for parseCoord

This commit is contained in:
Matt Goodrich 2020-06-04 14:43:11 -04:00
parent e730f81c3f
commit e5ad8934d8
1 changed files with 1 additions and 1 deletions

View File

@ -682,7 +682,7 @@ bool Adafruit_GPS::parseCoord(char *pStart, nmea_float_t *angleDegrees,
char *p = pStart; char *p = pStart;
if (!isEmpty(p)) { if (!isEmpty(p)) {
// get the number in DDDMM.mmmm format and break into components // get the number in DDDMM.mmmm format and break into components
char degreebuff[10]; char degreebuff[10] = {0}; // Ensure string is terminated after strncpy
char *e = strchr(p, '.'); char *e = strchr(p, '.');
if (e == NULL || e - p > 6) if (e == NULL || e - p > 6)
return false; // no decimal point in range return false; // no decimal point in range