s4/libcli: clang: Fix 'initialization value is never read'
authorNoel Power <noel.power@suse.com>
Thu, 11 Jul 2019 11:31:03 +0000 (11:31 +0000)
committerGary Lockyer <gary@samba.org>
Tue, 16 Jul 2019 22:52:24 +0000 (22:52 +0000)
Fixes:

source4/libcli/smb_composite/fetchfile.c:91:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
        NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
                 ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source4/libcli/smb_composite/fetchfile.c

index dc6f71b452e2262512102bac405b9af0bcceabc5..30e3a626ce677c161375c74dfec5fc649887ad6f 100644 (file)
@@ -88,7 +88,7 @@ static NTSTATUS fetchfile_read(struct composite_context *c,
 static void fetchfile_state_handler(struct composite_context *c)
 {
        struct fetchfile_state *state;
-       NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
+       NTSTATUS status;
        
        state = talloc_get_type(c->private_data, struct fetchfile_state);
 
@@ -101,6 +101,9 @@ static void fetchfile_state_handler(struct composite_context *c)
        case FETCHFILE_READ:
                status = fetchfile_read(c, state->io);
                break;
+       default:
+               status = NT_STATUS_UNSUCCESSFUL;
+               break;
        }
 
        if (!NT_STATUS_IS_OK(status)) {