Submitted by: Julia Lawall <julia@diku.dk>
[openssl.git] / apps / ts.c
index d73b4eb5addf81fce577b739b2f93058aaf7ce85..bedb602fd5d5648aec544ffc3b5d2e29cff9ba92 100644 (file)
--- a/apps/ts.c
+++ b/apps/ts.c
@@ -649,7 +649,7 @@ static ASN1_INTEGER *create_nonce(int bits)
 
        /* Generating random byte sequence. */
        if (len > (int)sizeof(buf)) goto err;
-       if (!RAND_bytes(buf, len)) goto err;
+       if (RAND_bytes(buf, len) <= 0) goto err;
 
        /* Find the first non-zero byte and creating ASN1_INTEGER object. */
        for (i = 0; i < len && !buf[i]; ++i);