NMEAParser
NMEAParser copied to clipboard
Incorrect conversion of RMC Speed in Knots
In the NMEASentenceRMC.cpp :
// Speed over ground knots
if (GetField(pData, szField, 6, c_nMaxField) == CNMEAParserData::ERROR_OK) {
m_SentenceData.m_dSpeedKnots = atol(szField);
}
the use of atol() is incorrect, it converts to long int, should be a floating point conversion with atof(), like this:
m_SentenceData.m_dSpeedKnots = atof(szField);