diff --git a/cv7/a_station.c b/cv7/a_station.c index c371e7e..bbb7c51 100644 --- a/cv7/a_station.c +++ b/cv7/a_station.c @@ -25,15 +25,15 @@ void destroy_station(struct station* station){ } int select_track(struct station* station, const char* target){ - if (target[0] >= 'A' && target[0] <= 'Z') { - return target[0] - 'A'; - - } else if (target[0] >= 'a' && target[0] <= 'z') { - return target[0] - 'a'; - + if (isalpha(target[0])) { + if (isupper(target[0])) { + return target[0] - 'A'; } else { - return 0; + return target[0] - 'a'; } + } else { + return 0; + } } void add_target_capacity(struct station* station,const char* target, int capacity){