In the operater manual of your company is stated how much duty time you may work in 1 shift, and with the corresponding rest periods. And it is not only the responsibility of the company but also of the pilot itself, that you don't exceed this times.
If it happens that because of a delay at airport B you know you won't be landing within your duty time limits at airport C you have the right to refuse the flight but you may chose to accept it, but the company has to file a report to the local authorities when such an event occurs.
But any normal company has a department keeping track of this and they will make sure they will operate within the rules since this items are being checked regulary by the authorities.