From 976ff207da315f05ed1cc967f1eb3c1e16aadbe6 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 27 Aug 2025 16:02:56 +1200 Subject: [PATCH] dsdb: audit: replace local min() with libreplace MIN() Signed-off-by: Douglas Bagnall Reviewed-by: Gary Lockyer --- source4/dsdb/samdb/ldb_modules/audit_log.c | 4 +--- source4/dsdb/samdb/ldb_modules/audit_util.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/audit_log.c b/source4/dsdb/samdb/ldb_modules/audit_log.c index 7cc3ff67d77..08d11141d29 100644 --- a/source4/dsdb/samdb/ldb_modules/audit_log.c +++ b/source4/dsdb/samdb/ldb_modules/audit_log.c @@ -65,8 +65,6 @@ */ #define MAX_LENGTH 1024 -#define min(a, b) (((a)>(b))?(b):(a)) - /* * Private data for the module, stored in the ldb_module private data */ @@ -881,7 +879,7 @@ static char *log_attributes( } v = message->elements[i].values[j]; - length = min(MAX_LENGTH, v.length); + length = MIN(MAX_LENGTH, v.length); use_b64_encode = ldb_should_b64_encode(ldb, &v); if (use_b64_encode) { const char *encoded = ldb_base64_encode( diff --git a/source4/dsdb/samdb/ldb_modules/audit_util.c b/source4/dsdb/samdb/ldb_modules/audit_util.c index 8fe7d8332d2..ea212469995 100644 --- a/source4/dsdb/samdb/ldb_modules/audit_util.c +++ b/source4/dsdb/samdb/ldb_modules/audit_util.c @@ -36,8 +36,6 @@ #define MAX_LENGTH 1024 -#define min(a, b) (((a)>(b))?(b):(a)) - /* * List of attributes considered secret or confidential the values of these * attributes should not be displayed in log messages. @@ -488,7 +486,7 @@ static int dsdb_audit_add_ldb_value(struct json_object *array, } base64 = ldb_should_b64_encode(NULL, &lv); - len = min(lv.length, MAX_LENGTH); + len = MIN(lv.length, MAX_LENGTH); value = json_new_object(); if (json_is_invalid(&value)) { goto failure; -- 2.47.3