In a recent work, Jarzynski and Wojcik (2004 Phys. Rev. Lett. 92, 230602) have shown by using the properties of Hamiltonian dynamics and a statistical mechanical consideration that, through contact, heat exchange between two systems initially prepared at different temperatures obeys a fluctuation theorem. Here, another proof is presented, in which only macroscopic thermodynamic quantities are employed. The detailed balance condition is found to play an essential role. As a result, the theorem is found to hold under very general conditions.