fix off by one in call to symbolize, and avoid nulls

This commit is contained in:
Alex Groce
2019-01-01 18:59:25 -07:00
parent 31460e7f0d
commit cc2925ffd2
3 changed files with 33 additions and 4 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ void printBytes(const char* bytes) {
#define MAX_STR_LEN 3
TEST(Runlength, EncodeDecode) {
char* original = DeepState_CStr(MAX_STR_LEN);
char* original = DeepState_CStrUpToLen(MAX_STR_LEN);
char* encoded = encode(original);
char* roundtrip = decode(encoded);
if (!(strncmp(roundtrip, original, MAX_STR_LEN) == 0)) {