On Tue, Nov 03, 2020 at 04:59:42PM +0300, Sergey Ostanevich wrote: > Hi! > > I double checked the snprintf fails only if buf is set to NULL _and_ the > len is set to a non-zero value. > > So I would follow Vlad's proposal on factoring out the code to make it > clearer. > > Sergos. Looks ok to me.