From: Thomas Pornin Date: Sat, 5 Nov 2016 01:29:18 +0000 (-0400) Subject: Fixed some small bugs. X-Git-Tag: v0.4~66 X-Git-Url: https://bearssl.org/gitweb//home/git/?p=BearSSL;a=commitdiff_plain;h=bab0f8639cb1e97c584e7751fd7d017e0e24da63 Fixed some small bugs. --- diff --git a/test/test_x509.c b/test/test_x509.c index a591b46..52a9e2c 100644 --- a/test/test_x509.c +++ b/test/test_x509.c @@ -258,6 +258,9 @@ HT_expand(HT *ht) n = ht->num_buckets; n2 = n << 1; new_buckets = xmalloc(n2 * sizeof *new_buckets); + for (u = 0; u < n2; u ++) { + new_buckets[u] = NULL; + } for (u = 0; u < n; u ++) { ht_elt *e, *f; @@ -509,7 +512,7 @@ static int string_to_time(const char *s, uint32_t *days, uint32_t *seconds) { int year, month, day, hour, minute, second; - int day_of_year, leaps; + int day_of_year, leaps, i; if (parse_dec(s, 4, &year) < 0) { return -1; @@ -568,7 +571,7 @@ string_to_time(const char *s, uint32_t *days, uint32_t *seconds) return -1; } day_of_year = 0; - for (int i = 1; i < month; i ++) { + for (i = 1; i < month; i ++) { day_of_year += month_length(year, i); } if (day < 1 || day > month_length(year, month)) { diff --git a/tools/client.c b/tools/client.c index 3b462a8..3686441 100644 --- a/tools/client.c +++ b/tools/client.c @@ -35,7 +35,6 @@ #include #include #include -#include #include "brssl.h" #include "bearssl.h" diff --git a/tools/server.c b/tools/server.c index fc16692..0572928 100644 --- a/tools/server.c +++ b/tools/server.c @@ -35,7 +35,6 @@ #include #include #include -#include #include "brssl.h" #include "bearssl.h" diff --git a/tools/sslio.c b/tools/sslio.c index 64d6c96..e784d07 100644 --- a/tools/sslio.c +++ b/tools/sslio.c @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include "brssl.h" #include "bearssl.h"