mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
libplugin: make set callback for options take plugin ptr, check correct type.
I added a plugin arg and was surprised that compile didn't break. This is because typesafe_cb et al are conditional casts: if the type isn't as expected it has no effect, but we're passing plugin_option() through varargs, so everything is accepted! Add a noop inline to check type, and fix up the two cases where we used `const char *` instead of `char *`. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include <common/memleak.h>
|
||||
#include <plugins/libplugin.h>
|
||||
|
||||
static const char *somearg;
|
||||
static char *somearg;
|
||||
static bool self_disable = false;
|
||||
static bool dont_shutdown = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user