diff --git a/README.txt b/README.txt
index b553039..514dbd3 100644
--- a/README.txt
+++ b/README.txt
@@ -18,8 +18,7 @@ Use -h switch to obtain all avaiable options.
ACKNOWLEDGEMENTS & LEGAL:
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
-You should have received a copy of the CC0 Public Domain Dedication along with this software.
-If not, see .
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see .
keccak.c is based on .
ed25519/ref10 is taken from SUPERCOP .
diff --git a/main.c b/main.c
index 0dba49d..1d23754 100644
--- a/main.c
+++ b/main.c
@@ -62,7 +62,7 @@ static void termhandler(int sig)
}
struct binfilter {
- u8 *f;
+ u8 f[PUBLIC_LEN];
size_t len; // real len minus one
u8 mask;
} ;
@@ -90,7 +90,6 @@ static void filters_add(const char *filter)
fprintf(stderr, "filter \"%s\" is too long\n", filter);
return;
}
- bf.f = malloc(ret);
ret2 = base32_from(bf.f,&bf.mask,filter);
assert(ret == ret2);
//printf("--m:%02X\n", bf.mask);
@@ -100,12 +99,14 @@ static void filters_add(const char *filter)
static void filters_clean()
{
- for (size_t i = 0; i < VEC_LENGTH(bfilters); ++i) {
- free(VEC_BUF(bfilters, i).f);
- }
VEC_FREE(bfilters);
}
+static size_t filters_count()
+{
+ return VEC_LENGTH(bfilters);
+}
+
static void loadfilterfile(const char *fname)
{
char buf[128];
@@ -543,6 +544,9 @@ int main(int argc, char **argv)
if (!quietflag)
printfilters();
+ if (!filters_count())
+ return 0;
+
if (workdir)
mkdir(workdir, 0700);