/* This used to crash us on 64-bit; submitted by
Alex Wulms <alex.wulms@scarlet.be> */
-#include "crcsync/crcsync.h"
-#include "crcsync/crcsync.c"
-#include "tap/tap.h"
+#include <ccan/crcsync/crcsync.h>
+#include <ccan/crcsync/crcsync.c>
+#include <ccan/tap/tap.h>
#include <stdlib.h>
#include <stdbool.h>
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));
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 */
}
}
ok1(expected_i == ARRAY_SIZE(expected));
-
+ crc_context_free(crcctx);
+ free(crc_info1.crcs);
return 0;
}