semicolon just after if() ?

Please explain what the 2nd line means when we put a semi colon just after if(...)

1
2
3
4
 if (m_dataOffset) {
				if (write(1, m_data, m_dataOffset));
				m_dataOffset = 0;
			}
That if is pointless as a semicolon negates the effect of the if (although the write() is performed), so m_dataOffset will always be set to 0 as long as the first if is true.
A statement that consists only of a a semicolon is called a null statement and it will do nothing.
Topic archived. No new replies allowed.