Garbage values are printing while getting GPS values

#1

My goal is to get GPS by parsing GPGGA string but the following error is generating.
How to parse Lat and Lan.
Error is as follows followed by code.

sscanf(data.p, “$GPGGA,%lf,%f,%c,%f,%c”,&time,&lat,&ns,&lon,&ew);

// LOG(LL_INFO, (“Scan Sentence %.*s”, data.len, data.p));
LOG(LL_INFO, (“What is string ‘%s’ \n”,data.p));
//strncpy(input,data.p,40);
//LOG(LL_INFO,(“String saved is ‘%s’”,input));
result = strstr(data.p,str);
char *str3="\0";
int res = strcmp(result,str3);
if(res!=0){
LOG(LL_INFO,(“String saved is ‘%s’”,result));
}
else{
LOG(LL_INFO,(“NO such string is present”));
}