From 1849016a4c0fd3d62b0acb66e7fd0f8c92b4c6fb Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Thu, 22 Oct 2020 00:37:06 -0400 Subject: Fix 4 more bugs in TACLeBench - anagram: Fix two off-by-ones, the heap size, and the result - rijndael_dec: Reset result checksum at job start - huff_enc: Reset mutable global variables at job start --- baseline/source/anagram/anagram.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'baseline/source/anagram/anagram.c') diff --git a/baseline/source/anagram/anagram.c b/baseline/source/anagram/anagram.c index fc8b6a8..feb9784 100644 --- a/baseline/source/anagram/anagram.c +++ b/baseline/source/anagram/anagram.c @@ -305,10 +305,10 @@ void anagram_ReadDict( void ) _Pragma( "loopbound min 1 max 5" ) while ( anagram_dictionary[ i ][ strlen ] != 0 ) strlen ++; - len += strlen + 2; + len += strlen + 3; } - pchBase = anagram_pchDictionary = ( char * )anagram_malloc( len ); + pchBase = anagram_pchDictionary = ( char * )anagram_malloc( len + 1 ); _Pragma( "loopbound min 2279 max 2279" ) for ( i = 0; i < anagram_DICTWORDS; i ++ ) { @@ -346,7 +346,7 @@ void anagram_init( void ) int anagram_return( void ) { int i; - char const *answer = "duke rip amy"; + char const *answer = "duke yip arm"; for ( i = 0; i < 12; i++ ) if ( answer[ i ] != anagram_buffer[ i ] ) -- cgit v1.2.2