aboutsummaryrefslogtreecommitdiffstats
path: root/src/anetz/stations.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/anetz/stations.c')
-rw-r--r--src/anetz/stations.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/anetz/stations.c b/src/anetz/stations.c
index 1b5bc50..9908755 100644
--- a/src/anetz/stations.c
+++ b/src/anetz/stations.c
@@ -151,15 +151,15 @@ double lat_from_coordinates(const char *string)
{
if (strlen(string) != 11)
abort();
- if (string[0] < '0' && string[0] > '9')
+ if (string[0] < '0' || string[0] > '9')
abort();
- if (string[1] < '0' && string[1] > '9')
+ if (string[1] < '0' || string[1] > '9')
abort();
if (string[2] != 'o')
abort();
- if (string[3] < '0' && string[3] > '9')
+ if (string[3] < '0' || string[3] > '9')
abort();
- if (string[4] < '0' && string[4] > '9')
+ if (string[4] < '0' || string[4] > '9')
abort();
return (double)(string[0] - '0') * 10.0 +
@@ -172,15 +172,15 @@ double lon_from_coordinates(const char *string)
{
if (strlen(string) != 11)
abort();
- if (string[6] < '0' && string[6] > '9')
+ if (string[6] < '0' || string[6] > '9')
abort();
- if (string[7] < '0' && string[7] > '9')
+ if (string[7] < '0' || string[7] > '9')
abort();
if (string[8] != 'o')
abort();
- if (string[9] < '0' && string[9] > '9')
+ if (string[9] < '0' || string[9] > '9')
abort();
- if (string[10] < '0' && string[10] > '9')
+ if (string[10] < '0' || string[10] > '9')
abort();
return (double)(string[6] - '0') * 10.0 +