This check should be done right after `headerfile = fopen("dumpit", "w");`