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

Attachment: signature.asc
Description: PGP signature

Reply via email to