From: Volker Lendecke Date: Wed, 1 Oct 2025 15:23:16 +0000 (+0200) Subject: vfs_fruit: Use all_zero() to check for an all-0 buffer X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91a75272058186f81896f2ecf508500094115db6;p=thirdparty%2Fsamba.git vfs_fruit: Use all_zero() to check for an all-0 buffer Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index d2d6c9f47b1..4e3ae2832a7 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -470,8 +470,6 @@ static bool del_fruit_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams, static bool ad_empty_finderinfo(const struct adouble *ad) { - int cmp; - char emptybuf[ADEDLEN_FINDERI] = {0}; char *fi = NULL; fi = ad_get_entry(ad, ADEID_FINDERI); @@ -479,18 +477,12 @@ static bool ad_empty_finderinfo(const struct adouble *ad) DBG_ERR("Missing FinderInfo in struct adouble [%p]\n", ad); return false; } - - cmp = memcmp(emptybuf, fi, ADEDLEN_FINDERI); - return (cmp == 0); + return all_zero((const uint8_t *)fi, ADEDLEN_FINDERI); } static bool ai_empty_finderinfo(const AfpInfo *ai) { - int cmp; - char emptybuf[ADEDLEN_FINDERI] = {0}; - - cmp = memcmp(emptybuf, &ai->afpi_FinderInfo[0], ADEDLEN_FINDERI); - return (cmp == 0); + return all_zero(&ai->afpi_FinderInfo[0], ADEDLEN_FINDERI); } /**