From ba89ab47e8f6c4844d1d801162397780ed57421c Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Sun, 3 Apr 2011 22:16:53 +0000 Subject: [PATCH] In t_fortuna.c, use a static buffer in head_tail_test, and use %f for a double argument, not %lf. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24830 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/krb/t_fortuna.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/crypto/krb/t_fortuna.c b/src/lib/crypto/krb/t_fortuna.c index 5931eb7e6..9ab7e499c 100644 --- a/src/lib/crypto/krb/t_fortuna.c +++ b/src/lib/crypto/krb/t_fortuna.c @@ -83,7 +83,8 @@ display(const unsigned char *data, size_t len) 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 @@ head_tail_test(struct fortuna_state *st) 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); } -- 2.26.2