Changeset 2302

Show
Ignore:
Timestamp:
01/17/08 16:50:58 (12 months ago)
Author:
edmanm
Message:

r39@lysithea: edmanm | 2008-01-17 16:50:51 -0500
Fixed a typo (I'm surprised this built), and clarify a function's comment.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vidalia/trunk/src/util/crypto.cpp

    r1912 r2302  
    7373 
    7474 
    75 /** Returns <b>len</b> bytes of pseudorandom data on success, or an empty 
    76  * QByteArray on failure. This function is based on crypto_seed_rng() from 
    77  * Tor's crypto.c. See LICENSE for details on Tor's license. */ 
     75/** Returns up to <b>len</b> bytes of pseudorandom data on success, or an empty 
     76 * QByteArray on failure. The caller should verify that the returned 
     77 * QByteArray contains the requested number of bytes. This function is based on 
     78 * crypto_seed_rng() from Tor's crypto.c. See LICENSE for details on Tor's 
     79 * license. */ 
    7880QByteArray 
    7981crypto_rand_bytes(int len) 
     
    117119      if (bytes_read < 0) 
    118120        return QByteArray(); 
    119       else if (read == 0) { 
     121      else if (bytes_read == 0) { 
    120122        buf.resize(total); 
    121123        return buf;