/* Get the next parameter from the gnss phrase. */
static char* gnss_get_next_param(char *src, const char *delim, char **saveptr)
/* Get the next parameter from the gnss phrase. */
static char* gnss_get_next_param(char *src, const char *delim, char **saveptr)
{
	char *start, *del;
	if (src) {
		start = src;
	} else {
		start = *saveptr;
	}
	if (!start) {
		return NULL;
	}
	if (*start == '\0' || *start == '\r') {
		return NULL;
	}
	del = strstr(start, delim);
	if (!del) {
		return NULL;
	}
	*del = '\0';
	*saveptr = del + 1;
	if (del == start) {
		return NULL;
	}
	return start;
}