For some reason the strcmp function generates a segmentation fault
when I run this code on the TS-7260. I am using the crosstools to
compile it. Has anyone else had this problem. Any ideas how to fix
it.
Thanks
Charlie
void gps_Capture()
{
char bufcopy[512], temp[512];
int res,bytes;
char gpapb[] = "$GPAPB", gpgll[] = "$GPGLL";
char *token = NULL;
ioctl(fd2,FIONREAD,&bytes);
if (bytes > 0 )
{
res = read(fd2,gpsbuf,512);
gpsbuf[res]=0;
if(res >10 )
{
token = strtok(gpsbuf,",");
if(strcmp(token, gpapb) == 0)
{
printf( "Token = \"%s\"\n", token );
}
}//end if(res > 0)
}//if (bytes > 0)
return;
}// end gps capture