Merge pull request #121 from drak7/master

Bugfix for parseCoord
This commit is contained in:
Limor "Ladyada" Fried 2020-06-04 15:14:30 -04:00 committed by GitHub
commit 2b20565cfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
if (!isEmpty(p)) {
// 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, '.');
if (e == NULL || e - p > 6)
return false; // no decimal point in range