Messages in this thread Patch in this message | | | Date | Mon, 26 Oct 2020 17:40:00 +0800 | Subject | [PATCH 1/1] f2fs-toos:fsck.f2fs Fix bad return value | From | Robin Hsu <> |
| |
'ret' should not have been used here: otherwise, it would be wrongly used as the error code and then be returned from main().
Signed-off-by: Robin Hsu <robinhsu@google.com> --- fsck/fsck.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fsck/fsck.c b/fsck/fsck.c index f97e9fb..66e4e3f 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -3137,8 +3137,7 @@ int fsck_verify(struct f2fs_sb_info *sbi) char ans[255] = {0}; printf("\nDo you want to restore lost files into ./lost_found/? [Y/N] "); - ret = scanf("%s", ans); - ASSERT(ret >= 0); + ASSERT(scanf("%s", ans) >= 0); if (!strcasecmp(ans, "y")) { for (i = 0; i < fsck->nr_nat_entries; i++) { if (f2fs_test_bit(i, fsck->nat_area_bitmap)) -- 2.29.0.rc2.309.g374f81d7ae-goog
| |