This commit is contained in:
Filip Chochol 2026-04-14 11:34:14 +02:00
parent f54bbf8531
commit dd425613b2

View File

@ -25,7 +25,7 @@ void destroy_station(struct station* stanica){
int select_track(struct station* stanica, const char* ciel){ int select_track(struct station* stanica, const char* ciel){
unsigned long heslo = 5381; unsigned long heslo = 5381;
int znak; int znak;
while ((znak == *ciel++)){ while ((znak = *ciel++)){
heslo = ((heslo << 5) + heslo) + znak; heslo = ((heslo << 5) + heslo) + znak;
} }
return heslo % stanica->track_count; return heslo % stanica->track_count;