diff options
author | Raúl Benencia <rul@kalgan.cc> | 2015-03-31 15:14:32 -0300 |
---|---|---|
committer | Raúl Benencia <rul@kalgan.cc> | 2015-03-31 15:14:32 -0300 |
commit | 85cdbcd8fa2867b5e36dc1705fdb17ce4a2a558b (patch) | |
tree | 637db5030421af3578ad0510ef242b0d31f82052 /lib | |
parent | b091b88da33fc0c02f87ee79f2235bd3eac18f74 (diff) |
change return value of coord_is_valid
Diffstat (limited to 'lib')
-rw-r--r-- | lib/coordinate.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/coordinate.c b/lib/coordinate.c index f92c22a..26bbca5 100644 --- a/lib/coordinate.c +++ b/lib/coordinate.c @@ -4,19 +4,19 @@ #include "coordinate.h" /* - * Returns 0 if the coordinate is between a1 and h8. + * Returns 1 if the coordinate is between a1 and h8. */ int coord_is_valid(char *s) { if (strnlen(s, 3) != 2) - return 1; + return 0; char col = tolower(s[0]); char row = tolower(s[1]); if (col >= 'a' && col <= 'h' && row >= '1' && row <= '8') - return 0; + return 1; - return 2; + return 0; } /* |