Protect the pointer array.

This commit is contained in:
Jonathan Naylor 2018-11-05 07:48:23 +00:00
parent 12396b5f1f
commit 08844423e3

View File

@ -129,7 +129,7 @@ void CGPSHandler::processNMEA()
char* p = NULL;
char* d = (char*)(m_data + 1U);
while ((p = ::strtok(d, ",\r\n")) != NULL) {
while ((p = ::strtok(d, ",\r\n")) != NULL && nRMC < 20U) {
pRMC[nRMC++] = p;
d = NULL;
}