diff options
Diffstat (limited to 'ft_tolower.c')
| -rw-r--r-- | ft_tolower.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ft_tolower.c b/ft_tolower.c index 5b5ee01..a6f5119 100644 --- a/ft_tolower.c +++ b/ft_tolower.c @@ -1,12 +1,12 @@ int ft_tolower(int c) { - unsigned char uc; - - uc = c; - /* if (c < -1) */ - /* return (c + 256); */ - - if (uc >= 'A' && uc <= 'Z') - return (uc - 'A' + 'a'); + if (c < -1) + return (c + 256); + if (c == -1) + return (-1); + if (c == 0) + return (0); + if (c >= 'A' && c <= 'Z') + return ('a' + c - 'A'); return (c); } |
