X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcrcsync%2Ftest%2Frun-crash.c;h=3bf49f64410341cd4eee62a26cb068cd10e59f40;hb=HEAD;hp=b187bac401be4f7ce4676aaa6c68c72704bd1d3f;hpb=39357f4e89f4ac02eb11861812cbfc67b4f1d4ef;p=ccan diff --git a/ccan/crcsync/test/run-crash.c b/ccan/crcsync/test/run-crash.c index b187bac4..3bf49f64 100644 --- a/ccan/crcsync/test/run-crash.c +++ b/ccan/crcsync/test/run-crash.c @@ -14,7 +14,7 @@ typedef struct { uint64_t *crcs; } crc_info_t; -static void crcblocks(crc_info_t *crc_info, char *data, int datalen, int blocksize) +static void crcblocks(crc_info_t *crc_info, const char *data, int datalen, int blocksize) { crc_info->block_count = (datalen+blocksize-1)/blocksize; crc_info->crcs = malloc(sizeof(uint64_t)*(crc_info->block_count + 1)); @@ -26,11 +26,11 @@ static void crcblocks(crc_info_t *crc_info, char *data, int datalen, int blocksi int main(int argc, char *argv[]) { /* Divided into BLOCKSIZE blocks */ - char *data1 = + const char *data1 = "abcde" "fghij" "klmno" "pqrst" "uvwxy" "z ABC" "DEFGH" "IJKLM" "NOPQR" "STUVW" "XYZ 0" "12345" "6789"; /* Divided into blocks that match. */ - char *data2 = + const char *data2 = /* NO MATCH */ "acde" /* MATCH */ @@ -92,6 +92,7 @@ int main(int argc, char *argv[]) } } ok1(expected_i == ARRAY_SIZE(expected)); - + crc_context_free(crcctx); + free(crc_info1.crcs); return 0; }