X-Git-Url: https://git.gag.com/?p=debian%2Fsplat;a=blobdiff_plain;f=utils%2Fcitydecoder.c;fp=utils%2Fcitydecoder.c;h=6f248c6e107e1b5cc9906d015c816c066a72f61c;hp=d3618f506cd14821ff303e1cda804b87c8d12498;hb=68a3cad00312b42922f10cc4822349802f50ed20;hpb=0fe7930a10436ce250cae6daf2077415f8727af6 diff --git a/utils/citydecoder.c b/utils/citydecoder.c index d3618f5..6f248c6 100644 --- a/utils/citydecoder.c +++ b/utils/citydecoder.c @@ -1,7 +1,7 @@ /**************************************************************************** * CITYDECODER: A SPLAT! File Conversion Utility * * Copyright John A. Magliacane, KD2BD 2002 * -* Last update: 13-Apr-2002 * +* Last update: 08-Feb-2009 * ***************************************************************************** * * * This utility reads ASCII Metadata Cartographic Boundary Files available * @@ -37,9 +37,9 @@ int main(argc,argv) char argc, *argv[]; { - int x, y, z; + int x, y, z, n; long attributefile_id, coordinatefile_id; - char string[80], name[80], attributefilename[15], coordinatefilename[15]; + char string[80], name[80], attributefilename[15], coordinatefilename[15], *s=NULL; double lat, lon; FILE *attributefile=NULL, *coordinatefile=NULL; @@ -62,34 +62,34 @@ char argc, *argv[]; /* Skip First ASCII File Record (ID=0) */ for (x=0; x<7; x++) - fgets(string,80,attributefile); + s=fgets(string,80,attributefile); do { string[0]=0; - fscanf(coordinatefile,"%ld", &coordinatefile_id); + n=fscanf(coordinatefile,"%ld", &coordinatefile_id); if (coordinatefile_id!=-99999) { name[0]=0; - fscanf(coordinatefile,"%lf %lf",&lon, &lat); + n=fscanf(coordinatefile,"%lf %lf",&lon, &lat); /* Read ID Number From Attribute File */ - fgets(string,80,attributefile); - sscanf(string,"%ld",&attributefile_id); + s=fgets(string,80,attributefile); + n=sscanf(string,"%ld",&attributefile_id); /* Skip Two Strings in Attribute File */ - fgets(string,80,attributefile); - fgets(string,80,attributefile); + s=fgets(string,80,attributefile); + s=fgets(string,80,attributefile); /* Read City Name From Attribute File */ - fgets(string,80,attributefile); + s=fgets(string,80,attributefile); /* Strip "quote" characters from name */ @@ -100,12 +100,12 @@ char argc, *argv[]; /* Skip Two Strings in Attribute File */ - fgets(string,80,attributefile); - fgets(string,80,attributefile); + s=fgets(string,80,attributefile); + s=fgets(string,80,attributefile); /* Skip blank line between records */ - fgets(string,80,attributefile); + s=fgets(string,80,attributefile); if (name[0]!=0 && name[0]!=' ' && feof(attributefile)==0 && attributefile_id==coordinatefile_id) printf("%s, %f, %f\n",name,lat,-lon); @@ -117,7 +117,7 @@ char argc, *argv[]; do { string[0]=0; - fscanf(coordinatefile,"%s",string); + n=fscanf(coordinatefile,"%s",string); } while (strncmp(string,"END",3)!=0 && feof(coordinatefile)==0);