From be8e261da6ba37d33fd17b25e0c4daee035ffa06 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 11 Feb 2020 14:45:20 +1030 Subject: [PATCH] ccan: update to include opt_unregister fix. This was caught by valgrind on Travis, and really confused me. Signed-off-by: Rusty Russell --- ccan/README | 2 +- ccan/ccan/opt/opt.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ccan/README b/ccan/README index d1fe493f5..978ba64a4 100644 --- a/ccan/README +++ b/ccan/README @@ -1,3 +1,3 @@ CCAN imported from http://ccodearchive.net. -CCAN version: init-2491-ga1f9c169 +CCAN version: init-2494-g4f20b75c diff --git a/ccan/ccan/opt/opt.c b/ccan/ccan/opt/opt.c index d4601dfbb..d376a598d 100644 --- a/ccan/ccan/opt/opt.c +++ b/ccan/ccan/opt/opt.c @@ -189,7 +189,8 @@ bool opt_unregister(const char *names) if (found == -1) return false; opt_count--; - memmove(&opt_table[found], &opt_table[found+1], opt_count - found); + memmove(&opt_table[found], &opt_table[found+1], + (opt_count - found) * sizeof(opt_table[found])); return true; }