From 391778fcb7e9e42b2061b9701e9757d41f754e94 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Fri, 5 Oct 2018 09:35:33 +0200 Subject: [PATCH] Fix error: illegal arithmetic on a pointer to void in binary '+' It is not allowed to do arithmentic on void pointers. Although it is possible on some compilers, this is no official C-behaviour because void is an incomplete object type: * https://stackoverflow.com/questions/3523145/pointer-arithmetic-for-void-pointer-in-c --- btree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btree.c b/btree.c index baa62af..882792b 100644 --- a/btree.c +++ b/btree.c @@ -720,7 +720,7 @@ int btree_node_is_full(struct btree_node *n) { * Note: this function does not change the position of the children as it * is intented to be used only on leafs. */ void btree_node_insert_key_at(struct btree_node *n, int i, unsigned char *key, uint64_t valoff) { - void *p; + char *p; p = n->keys + (i*BTREE_HASHED_KEY_LEN); memmove(p+BTREE_HASHED_KEY_LEN,p,(n->numkeys-i)*BTREE_HASHED_KEY_LEN);