If morning comes and a person is in a state of janaabah (impurity following sexual intercourse), this does not affect his fasting. He or she is permitted to delay doing ghusl, whether it is for janaabah or following menstruation or post-natal bleeding, until dawn has appeared (though well before sunrise), but it is better to hasten to do ghusl so that one can pray.