]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Simplify smbd_smb2_query_directory_send()
authorVolker Lendecke <vl@samba.org>
Sat, 23 Nov 2024 14:58:32 +0000 (15:58 +0100)
committerMartin Schwenke <martins@samba.org>
Mon, 2 Dec 2024 04:53:33 +0000 (04:53 +0000)
We don't need to call strcmp() to find an empty string.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
source3/smbd/smb2_query_directory.c

index 7e039c096058f97c84b49d37f9a873fa127929eb..9b1c7b0cbca7c43b864ca4085b114c05649c37eb 100644 (file)
@@ -301,7 +301,7 @@ static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       if (strcmp(state->in_file_name, "") == 0) {
+       if (state->in_file_name[0] == '\0') {
                tevent_req_nterror(req, NT_STATUS_OBJECT_NAME_INVALID);
                return tevent_req_post(req, ev);
        }