]> infiniteadaptability.org Git - seeder/commitdiff
...
authoralex <[email protected]>
Thu, 25 Nov 2021 01:12:54 +0000 (17:12 -0800)
committeralex <[email protected]>
Thu, 25 Nov 2021 01:12:54 +0000 (17:12 -0800)
inc/block.h
src/block.c
test/unit/block.tests.c

index fa7496d454b00d4ff8ca89739f95c7af16800158..d3798ba192ff4193b199c421d4e17e0f555599eb 100644 (file)
@@ -10,7 +10,6 @@
 #define BLOCK_SIZE 16384
 
 struct block {
-       uint8_t *data;
        unsigned char hash[crypto_hash_sha256_BYTES];
        struct block *next;
 };
index bbff2eafc32299a4fd19850a76f2ead9fd0ce4b8..6870fd248461a69de3ec1a153388b35ca117103a 100644 (file)
@@ -28,10 +28,6 @@ void block_free(struct block *p) {
        struct block *next;
 
        while(p!=NULL) {
-               if(p->data!=NULL) {
-                       free(p->data);
-               }
-
                next = p->next;
                free(p);
                p = next;
@@ -47,7 +43,6 @@ int block_init(struct block **p) {
                return -1;
        }
 
-       (*p)->data = NULL;
        memset((*p)->hash,0,crypto_hash_sha256_BYTES);
        (*p)->next = NULL;
 
index 984bcf9ef9c84ed018f40243d567d8a776435299..21cd4d9b7810bd355e1928e37337797cc9701d15 100644 (file)
@@ -65,7 +65,6 @@ static void block_init_basic_test() {
        assert(block_init(NULL)==-1);
        assert(block_init(&p)==1);
 
-       assert(p->data==NULL);
        assert(p->next==NULL);
        assert(memcmp(p->hash,expected,crypto_hash_sha256_BYTES)==0);