]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Slightly simplify ad_read_rsrc_adouble()
authorVolker Lendecke <vl@samba.org>
Thu, 2 Oct 2025 09:46:40 +0000 (11:46 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 8 Oct 2025 08:01:30 +0000 (08:01 +0000)
We have the MIN() macro for this

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/lib/adouble.c

index bc48c9d8e2ec91de2c427dcf1f3023b3a37d6274..7d37792b51cc26f7027a633c6eafa04f0fe31c5e 100644 (file)
@@ -2369,9 +2369,7 @@ static ssize_t ad_read_rsrc_adouble(vfs_handle_struct *handle,
        }
 
        to_read = ad->ad_fsp->fsp_name->st.st_ex_size;
-       if (to_read > AD_XATTR_MAX_HDR_SIZE) {
-               to_read = AD_XATTR_MAX_HDR_SIZE;
-       }
+       to_read = MIN(to_read, AD_XATTR_MAX_HDR_SIZE);
 
        len = SMB_VFS_NEXT_PREAD(handle,
                                 ad->ad_fsp,