From 5e300f063305ae3c199a7284dcd24a0d99a17131 Mon Sep 17 00:00:00 2001 From: Gijs Vermeulen Date: Mon, 17 Aug 2020 18:59:10 +0200 Subject: [PATCH] fsutil: Initialize ret in hardlink() (Coverity). Signed-off-by: Gijs Vermeulen Signed-off-by: Alexandre Julliard --- programs/fsutil/main.c | 2 +- programs/fsutil/tests/fsutil.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/programs/fsutil/main.c b/programs/fsutil/main.c index bde07ac2df5..0bc8817b88f 100644 --- a/programs/fsutil/main.c +++ b/programs/fsutil/main.c @@ -97,7 +97,7 @@ static int create_hardlink(int argc, WCHAR *argv[]) static int hardlink(int argc, WCHAR *argv[]) { - int ret; + int ret = 0; if (argc > 2) { diff --git a/programs/fsutil/tests/fsutil.c b/programs/fsutil/tests/fsutil.c index 98677882741..1111b5b2fed 100644 --- a/programs/fsutil/tests/fsutil.c +++ b/programs/fsutil/tests/fsutil.c @@ -63,6 +63,12 @@ static void test_hardlink(void) ok(hfile != INVALID_HANDLE_VALUE, "failed to create a file\n"); CloseHandle(hfile); + rc = runcmd("fsutil"); + ok(rc == 0, "failed to run fsutil\n"); + + rc = runcmd("fsutil hardlink"); + ok(rc == 0, "failed to run fsutil hardlink\n"); + rc = runcmd("fsutil hardlink create link file"); ok(rc == 0, "failed to create a hardlink\n");