From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 142F54765E0 for ; Sun, 27 Dec 2020 00:38:13 +0300 (MSK) Received: by mail-lf1-f48.google.com with SMTP id o19so16090664lfo.1 for ; Sat, 26 Dec 2020 13:38:13 -0800 (PST) From: Cyrill Gorcunov Date: Sun, 27 Dec 2020 00:38:09 +0300 Message-Id: <20201226213809.511284-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH] cfg: fix format in error message List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Cc: Vladislav Shpilevoy Coverity pointed that quorum value is int64_t wide and could be trimmed in error message. Fix it using proper formatting. CID 1500388 Part-of #5446 Signed-off-by: Cyrill Gorcunov --- branch gorcunov/gh-5446-fixup for 2.6 and 2.5 src/box/box.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/box/box.cc b/src/box/box.cc index e1d8305c8..3c5873e3c 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -623,10 +623,10 @@ box_eval_replication_synchro_quorum(int nr_replicas) if (quorum <= 0 || quorum >= VCLOCK_MAX) { const char *msg = tt_sprintf("the formula is evaluated " - "to the quorum %d for replica " + "to the quorum %lld for replica " "number %d, which is out of range " - "[%d;%d]", - quorum, nr_replicas, 1, VCLOCK_MAX - 1); + "[%d;%d]", (long long)quorum, + nr_replicas, 1, VCLOCK_MAX - 1); diag_set(ClientError, ER_CFG, "replication_synchro_quorum", msg); return -1; -- 2.26.2