Praise be to Allah.
Cursing does not invalidate your fast , but it does detract from your reward. The Muslim should control himself and guard his tongue against swearing , reviling, backbiting , gossiping and other things that Allah has forbidden whether one is fasting or not. But when one is fasting it is more serious and he should be more careful in preserving the integrity of his fast, and avoid that which will harm people or be a cause of trouble, anger and division.
The Prophet (peace and blessings of Allah be upon him) said: “If one if you is fasting, let him not utter obscenities on that day or raise his voice, and if anyone reviles him or wants to pick a fight with him, let him say ‘I am a person who is fasting .’” (Agreed upon)
And Allah is the Source of strength. May Allah send blessings and peace upon our Prophet Muhammad and his family and companions.