Imported Debian patch 1.2.0b-1
[debian/splat] / splat.cpp
index 4c801c02913af133d86f894db828b8584296056f..8aee28727c97952847e128a904a5205a07d48c13 100644 (file)
--- a/splat.cpp
+++ b/splat.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *      SPLAT: An RF Signal Propagation Loss and Terrain Analysis Tool       *
-*                        Last update: 21-Dec-2006                          *
+*                        Last update: 15-Mar-2007                          *
 *****************************************************************************
 *           Project started in 1997 by John A. Magliacane, KD2BD           *
 *****************************************************************************
@@ -56,7 +56,7 @@
 #define ARRAYSIZE 30025
 #endif
 
-char   string[255], sdf_path[255], opened=0, *splat_version={"1.2.0"};
+char   string[255], sdf_path[255], opened=0, *splat_version={"1.2.0b"};
 
 double TWOPI=6.283185307179586, HALFPI=1.570796326794896,
        PI=3.141592653589793, deg2rad=1.74532925199e-02,
@@ -2459,8 +2459,7 @@ void PlotLRPath(struct site source, struct site destination, FILE *fd)
        double  loss, azimuth, pattern=0.0, 
                source_alt, dest_alt, source_alt2, dest_alt2,
                cos_xmtr_angle, cos_test_angle=0.0, test_alt,
-               elevation, distance=0.0,
-               four_thirds_earth;
+               elevation, distance=0.0, four_thirds_earth;
        struct  site temp;
 
        ReadPath(source,destination);
@@ -2509,9 +2508,9 @@ void PlotLRPath(struct site source, struct site destination, FILE *fd)
                                   that determines the elevation angle to the first
                                   obstruction along the path is bypassed. */
 
-                               for (x=2, block=0; x<y && block==0; x++)
+                               for (x=2, block=0; (x<y && block==0); x++)
                                {
-                                       distance=5280.0*(path.distance[y]-path.distance[x]);
+                                       distance=5280.0*path.distance[x];
                                        test_alt=four_thirds_earth+path.elevation[x];
 
                                        /* Calculate the cosine of the elevation
@@ -3906,14 +3905,14 @@ void GraphHeight(struct site source, struct site destination, char *name, double
        {
                if (metric)
                {
-                       fprintf(fd3,"%f\t%f\n",path.distance[path.length-1],r);
-                       fprintf(fd4,"%f\t%f\n",path.distance[path.length-1],r);
+                       fprintf(fd3,"%f\t%f\n",KM_PER_MILE*path.distance[path.length-1],METERS_PER_FOOT*r);
+                       fprintf(fd4,"%f\t%f\n",KM_PER_MILE*path.distance[path.length-1],METERS_PER_FOOT*r);
                }
 
                else
                {
-                       fprintf(fd3,"%f\t%f\n",KM_PER_MILE*path.distance[path.length-1],METERS_PER_FOOT*r);
-                       fprintf(fd4,"%f\t%f\n",KM_PER_MILE*path.distance[path.length-1],METERS_PER_FOOT*r);
+                       fprintf(fd3,"%f\t%f\n",path.distance[path.length-1],r);
+                       fprintf(fd4,"%f\t%f\n",path.distance[path.length-1],r);
                }
        }
        
@@ -5342,7 +5341,7 @@ void WriteKML(struct site source, struct site destination)
        fflush(stdout);
 }
 
-int main(char argc, char *argv[])
+int main(int argc, char *argv[])
 {
        int             x, y, z=0, min_lat, min_lon, max_lat, max_lon,
                        rxlat, rxlon, txlat, txlon, west_min, west_max,
@@ -6017,7 +6016,8 @@ int main(char argc, char *argv[])
 
        if (freq==0.0 && nf==0)
                freq=LR.frq_mhz;
-       else
+
+       else if (nf==1)
                freq=0.0;
 
        if (coverage | LRmap)