From b9ca1c24e4fefbda0c26e7c9d9afbff7c0e3a6aa Mon Sep 17 00:00:00 2001
From: Serge Petrenko <sergepetrenko@tarantool.org>
Date: Tue, 27 Dec 2022 13:34:08 +0300
Subject: [PATCH] box: replace hardcoded constants with sizeof in
 box_broadcast_*

In-scope-of #5272

NO_DOC=refactoring
NO_TEST=refactoring
NO_CHANGELOG=refactoring
---
 src/box/box.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/box/box.cc b/src/box/box.cc
index 9ba096efa4..ca239ae93b 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -4613,7 +4613,7 @@ box_broadcast_id(void)
 
 	box_broadcast("box.id", strlen("box.id"), buf, w);
 
-	assert((size_t)(w - buf) < 1024);
+	assert((size_t)(w - buf) < sizeof(buf));
 }
 
 static void
@@ -4631,7 +4631,7 @@ box_broadcast_status(void)
 
 	box_broadcast("box.status", strlen("box.status"), buf, w);
 
-	assert((size_t)(w - buf) < 1024);
+	assert((size_t)(w - buf) < sizeof(buf));
 }
 
 void
@@ -4653,7 +4653,7 @@ box_broadcast_election(void)
 
 	box_broadcast("box.election", strlen("box.election"), buf, w);
 
-	assert((size_t)(w - buf) < 1024);
+	assert((size_t)(w - buf) < sizeof(buf));
 }
 
 void
@@ -4667,7 +4667,7 @@ box_broadcast_schema(void)
 
 	box_broadcast("box.schema", strlen("box.schema"), buf, w);
 
-	assert((size_t)(w - buf) < 1024);
+	assert((size_t)(w - buf) < sizeof(buf));
 }
 
 void
-- 
GitLab