[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[vidalia-svn] r2302: Fixed a typo (I'm surprised this built), and clarify a funct (in vidalia/trunk: . src/util)



Author: edmanm
Date: 2008-01-17 16:50:58 -0500 (Thu, 17 Jan 2008)
New Revision: 2302

Modified:
   vidalia/trunk/
   vidalia/trunk/src/util/crypto.cpp
Log:
 r39@lysithea:  edmanm | 2008-01-17 16:50:51 -0500
 Fixed a typo (I'm surprised this built), and clarify a function's comment.



Property changes on: vidalia/trunk
___________________________________________________________________
 svk:merge ticket from /local/vidalia/trunk [r39] on 90112fd6-a33b-4cea-8d39-48ff1d78625c

Modified: vidalia/trunk/src/util/crypto.cpp
===================================================================
--- vidalia/trunk/src/util/crypto.cpp	2008-01-16 22:46:55 UTC (rev 2301)
+++ vidalia/trunk/src/util/crypto.cpp	2008-01-17 21:50:58 UTC (rev 2302)
@@ -72,9 +72,11 @@
 #endif
 
 
-/** Returns <b>len</b> bytes of pseudorandom data on success, or an empty
- * QByteArray on failure. This function is based on crypto_seed_rng() from
- * Tor's crypto.c. See LICENSE for details on Tor's license. */
+/** Returns up to <b>len</b> bytes of pseudorandom data on success, or an empty
+ * QByteArray on failure. The caller should verify that the returned
+ * QByteArray contains the requested number of bytes. This function is based on
+ * crypto_seed_rng() from Tor's crypto.c. See LICENSE for details on Tor's
+ * license. */
 QByteArray
 crypto_rand_bytes(int len)
 {
@@ -116,7 +118,7 @@
       bytes_read = file.read(buf.data()+total, buf.size()-total);
       if (bytes_read < 0)
         return QByteArray();
-      else if (read == 0) {
+      else if (bytes_read == 0) {
         buf.resize(total);
         return buf;
       }