FR 2540 then UX 1145 at Madrid
Bucharest → Madrid → Porto
Timetable, Madrid time
13:55FR 2540 from Bucharest at the gate
10:35UX 1145 to Porto leaves the gate
20 h 40 apart on the timetable, overnight
UX 1145 leaves 20 h 40 after FR 2540 arrives on the timetable: more than half a day, so not a connection we count.