"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
Re: *printf return value
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Wed, 10 Aug 2022 14:54:16 +0200

Download raw body.

Thread
> I've also spotted some unneeded checks for snprintf.  The correct
> check would be `ret < 0', but since snprintf can only fail due to an
> encoding error, I think we can just check for the partial write.

I'd rather you changed those into ret < 0 to match what the CAVEAT in
the snprintf(3) manual says - it used to say ret == -1 but that was
changed a few years back because standards decided to allow negative
returns instead of only -1.