From 3b0e24c06be1f7ac25f1410831baa848d0f012d3 Mon Sep 17 00:00:00 2001 From: Paul Cruz Date: Wed, 14 Jun 2017 12:04:22 -0700 Subject: [PATCH] added error message to catch case where size not given --- tests/decodecorpus.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/decodecorpus.c b/tests/decodecorpus.c index 5a897cc4e..9bd6506e2 100644 --- a/tests/decodecorpus.c +++ b/tests/decodecorpus.c @@ -1326,12 +1326,15 @@ static int generateCorpusWithDict(U32 seed, unsigned numFiles, const char* const DISPLAY("Error: path too long\n"); return 1; } - + if(dictSize < 400){ + DISPLAY("Error: either no size given or given dictionary size is too small\n"); + return 1; + } /* Generate the dictionary randomly first */ dictContent = malloc(dictSize-400); dictID = RAND(&seed); fullDict = malloc(dictSize); - RAND_buffer(&seed, dictContent, dictSize-40); + RAND_buffer(&seed, dictContent, dictSize-400); { size_t dictWriteSize = 0;