From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (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 9502142EF62 for ; Thu, 18 Jun 2020 01:04:54 +0300 (MSK) Received: by mail-lj1-f193.google.com with SMTP id n23so4799601ljh.7 for ; Wed, 17 Jun 2020 15:04:54 -0700 (PDT) From: Cyrill Gorcunov Date: Thu, 18 Jun 2020 01:03:35 +0300 Message-Id: <20200617220335.836265-7-gorcunov@gmail.com> In-Reply-To: <20200617220335.836265-1-gorcunov@gmail.com> References: <20200617220335.836265-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 6/6] xlog: xdir_format_filename -- use PATH_MAX List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Cc: Vladislav Shpilevoy , Alexander Turenko No need for +1 byte here, PATH_MAX already implies end of string. Signed-off-by: Cyrill Gorcunov --- src/box/xlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/box/xlog.c b/src/box/xlog.c index 94f7838bf..bf68c6925 100644 --- a/src/box/xlog.c +++ b/src/box/xlog.c @@ -650,7 +650,7 @@ const char * xdir_format_filename(struct xdir *dir, int64_t signature, enum log_suffix suffix) { - return tt_snprintf(PATH_MAX + 1, "%s/%020lld%s%s", + return tt_snprintf(PATH_MAX, "%s/%020lld%s%s", dir->dirname, (long long) signature, dir->filename_ext, suffix == INPROGRESS ? inprogress_suffix : ""); -- 2.26.2