From 85cdbcd8fa2867b5e36dc1705fdb17ce4a2a558b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Benencia?= Date: Tue, 31 Mar 2015 15:14:32 -0300 Subject: change return value of coord_is_valid --- lib/coordinate.c | 8 ++++---- 1 file 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; } /* -- cgit v1.2.3