aboutsummaryrefslogtreecommitdiffstats
path: root/src/anetz
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2017-07-27 12:05:11 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2017-08-08 12:54:21 +0200
commit7c9ce960d70a92cbace3c4030f4faabcf378ef42 (patch)
tree2518dd842f244deaf4a622b89994b121912f15d9 /src/anetz
parent5090f5a18d0c6a0494fe92268112613fef9be0e0 (diff)
Fixes of checking digits
Diffstat (limited to 'src/anetz')
-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 +