- int i = 0;
- while (infoString[i] != '\t')
- i++;
- char buffer[128];
- char latlon[128];
- strncpy(buffer, infoString, i);
- buffer[i] = 0;
- countryCode = strdup(buffer);
- i ++;
- int start = i;
- while (infoString[i] != '\t')
- i++;
- int size = i - start;
- strncpy(latlon, (&infoString[start]), size);
- latlon[size] = 0;
- char sign;
- sign = latlon[0];
- strncpy(buffer, &latlon[1], 2);
- lat = atof(buffer);
- strncpy(buffer, &latlon[3], 2);
- lat += (atof(buffer) / 60);
- int nextPos;
- if (strlen(latlon) > 12)
- {
- nextPos = 7;
- strncpy(buffer, &latlon[5], 2);
- lat += (atof(buffer) / 3600.0);
+ int i = 0;
+ while (infoString[i] != '\t')
+ i++;
+ char buffer[128];
+ char latlon[128];
+ strncpy(buffer, infoString, i);
+ buffer[i] = 0;
+ countryCode = strdup(buffer);
+ i ++;
+ int start = i;
+ while (infoString[i] != '\t') {
+ i++;
+ }
+ int size = i - start;
+ strncpy(latlon, (&infoString[start]), size);
+ latlon[size] = 0;
+ char sign;
+ sign = latlon[0];
+ strncpy(buffer, &latlon[1], 2);
+ lat = atof(buffer);
+ strncpy(buffer, &latlon[3], 2);
+ lat += (atof(buffer) / 60);
+ int nextPos;
+ if (strlen(latlon) > 12) {
+ nextPos = 7;
+ strncpy(buffer, &latlon[5], 2);
+ lat += (atof(buffer) / 3600.0);
+ } else {
+ nextPos = 5;
+ }
+ if (sign == '-') {
+ lat = -lat;