]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix inner loop index variable. i and j are too close together ;)
authorTommi Virtanen <tv@hq.newdream.net>
Wed, 2 Feb 2011 17:59:49 +0000 (09:59 -0800)
committerTommi Virtanen <tv@hq.newdream.net>
Wed, 2 Feb 2011 18:04:34 +0000 (10:04 -0800)
Before this fix, j would keep increasing well beyond in_len,
and lead to segfaults.

src/test/base64.cc

index e3b58c0c83052084d41a72e4c310fcda9c4ad137..0ff580c51b0f8a52c79d3d24d04c0c00aef69265 100644 (file)
@@ -44,7 +44,7 @@ TEST(RoundTrip, RandomRoundTrips) {
 
     char in[IN_MAX];
     memset(in, 0, sizeof(in));
-    for (int j = 0; i < in_len; ++j) {
+    for (int j = 0; j < in_len; ++j) {
       in[j] = rand_r(&seed) % 0xff;
     }
     char out[OUT_MAX];