Re: [PATCH] Improve mutt's random data generator.

"Kevin J. McCarthy" <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <aerHPnFwpTFJUSSY@qinghai>
On Thu, Apr 23, 2026 at 08:02:49PM -0400, Kurt Hackenberg wrote:
>On Fri, Apr 24, 2026 at 06:54 +0800, Kevin J. McCarthy wrote:
>
>>(replying to the sub-thread with Kurt lower): I realized the return 
>>type is actually ssize_t, but I chose to work with size_t in this 
>>case because of the:
>>
>>   if (res < length_requested)
>>   {
>>     length_requested -= res;
>>     random_bytes += res;
>>   }
>
>I hope that code is not executed if the return value is -1.

Yup.  That's exactly what I meant by making the code clearer.  If res is 
type size_t, then it can't be -1 in that comparison.

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmnqxz4ACgkQre92hIAx
a9rHhRAAphwrdjaR0+z9TDdWq3dTjKNu5T02xGo8NDIAyRtBe89Idax/xvoHdr0m
BmRp9muorzRGVfL6MUOBRXm/hIX8IJTZ6AGzuXgYlKidOuzOMtL9X9xmUfZ1MnEo
srLFlbk79qHQBUKi2h74CH2GtpjFsQF7Tm37bOx1T5yOCRWWdc3Wzo8I/VRlGlOG
tJq7ZqyJdST8bEE1SSzVhSHemysZC1b8xwSdBVPMQ8ljNuupCnmSF/KIJLO7pKQc
4okcUwv2Rr64qz/x9siWkV9iE5EQxq+3LZbsJ6p6wW3u6/oo3zpdlsgk3YQxlGnL
49rcixrCZEKKh3+/MaLJjJa/X0mEidrPkxU8gA4r9/LEuE5bLtcNKXHUtvff1T6r
DW21FrFLPG5SvMwbMkDar7PkNXq20/sUyFRaWARGsZhoOmPhWt0G7bt7vIzZ/bnd
p3z5at4Lsg8vPOsACIrBQT+g/BVfJ6amGLOg5CL6FSUh23e0Q4/4p2itvWEuvafe
4PFqcTVNN2lLAdLPZccxm38C0bmUrYjhKzrL1Z4Ll4BB1UKP6OCh7RlOZgfHMUQG
mmB1Vya4HXcb88A6eBba4ZR+0pRd9SXxR3EsM3JN4vAeJ7yFdrHr46ya7jZLmPDl
qpRr+8co4EWUjN2YWAieBHORovkqoeXab71E231rd5RN5l/Abbk=
=czWC
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.