strtok doesn't parse correctly following message:
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
Resulting in "datagram has wrong parameter count".
Signed-off-by: Petr Štetiar <ynezz@true.cz>
nmea_tokenize(char *msg)
{
int cnt = 0;
- char *tok = strtok(msg, ",");
+ char *tok = strsep(&msg, ",");
while (tok && cnt < MAX_NMEA_PARAM) {
nmea_params[cnt].str = tok;
nmea_params[cnt].num = atoi(tok);
cnt++;
- tok = strtok(NULL, ",");
+ tok = strsep(&msg, ",");
}
return cnt;