If consumption fails, we cannot trust that 'magic' was populated with
anything useful. To compound on this, 'magic' is initialized with
0xd00dfeed. These facts combined meant that piping completely broken or
missing output into dtc would always result in an error message like:
Missing magic token in header. Got d00dfeed expected 0xd00dfeed
Which is wrong, since it most certainly did not get d00dfeed. Instead of
removing the initialization, just split it out so we have two obviously
different error cases: Missing magic token, and incorrect magic token.
If consumption fails, we cannot trust that 'magic' was populated with anything useful. To compound on this, 'magic' is initialized with 0xd00dfeed. These facts combined meant that piping completely broken or missing output into dtc would always result in an error message like:
Missing magic token in header. Got d00dfeed expected 0xd00dfeed
Which is wrong, since it most certainly did not get d00dfeed. Instead of removing the initialization, just split it out so we have two obviously different error cases: Missing magic token, and incorrect magic token.