From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (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 0ABFC469710 for ; Tue, 12 May 2020 23:56:31 +0300 (MSK) Received: by mail-lj1-f195.google.com with SMTP id h4so15285928ljg.12 for ; Tue, 12 May 2020 13:56:30 -0700 (PDT) Date: Tue, 12 May 2020 23:56:28 +0300 From: Cyrill Gorcunov Message-ID: <20200512205628.GH2219@grain> References: <449685df941ca9a14e102738da413e737e559aea.1589240704.git.v.shpilevoy@tarantool.org> <20200512151324.GA2219@grain> <87a91d28-3c4c-a37e-40c0-595faa0ea0d5@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a91d28-3c4c-a37e-40c0-595faa0ea0d5@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH 2/5] decimal: provide MP_DECIMAL extension serializer List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org On Tue, May 12, 2020 at 10:30:24PM +0200, Vladislav Shpilevoy wrote: > > > > This looks suspicious -- if buffer size is not enough the snprintf > > returns not the number of bytes really written but rather a number > > of bytes needed to write the desired string. Are you sure it is > > safe to return snprintf result here? > > Yes, I am sure it is safe and correct. mp_snprint() returns exactly this - > an snprintf-like result. So all printers, used inside of it, should do the > same. At least this is what is documented and covered by existing tests. Yeah, I realized later than this is don on purpose, that's why I put my ack in reply.