From bde7428542598b838c5225b428b1e7c55b8ece29 Mon Sep 17 00:00:00 2001 From: Kevin Greenan Date: Tue, 22 Jul 2014 12:31:17 -0700 Subject: Fix simple encode_decode unit test and remove debugging prints. --- src/erasurecode_preprocessing.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/erasurecode_preprocessing.c') diff --git a/src/erasurecode_preprocessing.c b/src/erasurecode_preprocessing.c index 6591180..d7f78b6 100644 --- a/src/erasurecode_preprocessing.c +++ b/src/erasurecode_preprocessing.c @@ -277,7 +277,7 @@ int fragments_to_string(int k, int m, int ret = -1; if (num_fragments < k) { - /* + /* * This is not necessarily an error condition, so *do not log here* * We can maybe debug log, if necessary. */ @@ -314,20 +314,20 @@ int fragments_to_string(int k, int m, continue; } else { /* Make sure we account for duplicates */ - if (NULL != data[index]) { + if (NULL != fragments[index]) { data[index] = fragments[i]; num_data++; } } + } - /* We do not have enough data fragments to do this! */ - if (num_data != k) { - /* - * This is not necessarily an error condition, so *do not log here* - * We can maybe debug log, if necessary. - */ - goto out; - } + /* We do not have enough data fragments to do this! */ + if (num_data != k) { + /* + * This is not necessarily an error condition, so *do not log here* + * We can maybe debug log, if necessary. + */ + goto out; } /* Create the string to return */ -- cgit v1.2.1