diff options
Diffstat (limited to 'cgpt')
-rw-r--r-- | cgpt/cgpt_wrapper.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cgpt/cgpt_wrapper.c b/cgpt/cgpt_wrapper.c index 50957ccb..f9288c15 100644 --- a/cgpt/cgpt_wrapper.c +++ b/cgpt/cgpt_wrapper.c @@ -125,9 +125,10 @@ static int wrap_cgpt(int argc, // Write back "rw_gpt" to NOR flash in two chunks. ret++; modified_hash = DigestFile(rw_gpt_path, SHA1_DIGEST_ALGORITHM); - if (original_hash != NULL && modified_hash != NULL && - memcmp(original_hash, modified_hash, SHA1_DIGEST_SIZE) != 0) { - if (WriteNorFlash(temp_dir) == 0) { + if (original_hash != NULL && modified_hash != NULL) { + if (memcmp(original_hash, modified_hash, SHA1_DIGEST_SIZE) != 0) { + ret = WriteNorFlash(temp_dir); + } else { ret = 0; } } |