svn rev #24830: trunk/src/lib/crypto/krb/

ghudson@MIT.EDU ghudson at MIT.EDU
Sun Apr 3 18:16:53 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=24830
Commit By: ghudson
Log Message:
In t_fortuna.c, use a static buffer in head_tail_test, and use %f for
a double argument, not %lf.



Changed Files:
U   trunk/src/lib/crypto/krb/t_fortuna.c
Modified: trunk/src/lib/crypto/krb/t_fortuna.c
===================================================================
--- trunk/src/lib/crypto/krb/t_fortuna.c	2011-04-03 22:10:03 UTC (rev 24829)
+++ trunk/src/lib/crypto/krb/t_fortuna.c	2011-04-03 22:16:53 UTC (rev 24830)
@@ -83,7 +83,8 @@
 static void
 head_tail_test(struct fortuna_state *st)
 {
-    unsigned char buffer[1024 * 1024], c;
+    static unsigned char buffer[1024 * 1024];
+    unsigned char c;
     size_t i, len = sizeof(buffer);
     int bit, bits[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
     double res;
@@ -104,7 +105,7 @@
         res = ((double)abs(len - bits[bit] * 2)) / (double)len;
         if (res > 0.005){
             fprintf(stderr,
-                    "Bit %d: %d zero, %d one exceeds 0.5%% variance (%lf)\n",
+                    "Bit %d: %d zero, %d one exceeds 0.5%% variance (%f)\n",
                     bit, (int)len - bits[bit], bits[bit], res);
             exit(1);
         }




More information about the cvs-krb5 mailing list