[Tarantool-patches] [PATCH 2/5] decimal: provide MP_DECIMAL extension serializer

Cyrill Gorcunov gorcunov at gmail.com
Tue May 12 23:56:28 MSK 2020


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.


More information about the Tarantool-patches mailing list