On Wed, Feb 08, 2023 at 02:37:32PM +0000, David Laight wrote: > [You don't often get email from david.laight@xxxxxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] > > From: Simon Horman > > Sent: 07 February 2023 15:43 > ... > > However, amongst other usages of the return value, > > those callers also check for a return < 0 from this function. > > Can that occur, in the sprintf or scnprintf case? > > That rather depends on what happens with calls like: > snprintf(NULL, 0, "*%s%*s", MAX_INT, "", MAX_INT, ""); > > That is a whole bag of worms you don't want to put your hand into. Ok :)