diff --git a/src/corrupter.c b/src/corrupter.c index 737c06c..8e92575 100644 --- a/src/corrupter.c +++ b/src/corrupter.c @@ -79,17 +79,18 @@ enum Interoperation_Result corrupt_byte(Interoperation_Input_Vars) { byte_value = FLIP_BIT(byte_value, bit); damaged_byte = true; + } + if (damaged_byte) { // write the modified byte back to the file FSEEK_MACRO(file, i, SEEK_SET); if (fwrite(&byte_value, sizeof(byte), 1, file) != 1) // on error return INTEROPERATION_ERROR; - } - if (damaged_byte) result->damaged_bytes++; + } return INTEROPERATION_SUCCESS; }