Commit 51840088 authored by Max Kellermann's avatar Max Kellermann

input_init: add assertions on completeness of plugins

parent cf696ce4
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "conf.h" #include "conf.h"
#include "glib_compat.h" #include "glib_compat.h"
#include <assert.h>
#include <string.h> #include <string.h>
static inline GQuark static inline GQuark
...@@ -67,6 +68,11 @@ input_stream_global_init(GError **error_r) ...@@ -67,6 +68,11 @@ input_stream_global_init(GError **error_r)
for (unsigned i = 0; input_plugins[i] != NULL; ++i) { for (unsigned i = 0; input_plugins[i] != NULL; ++i) {
const struct input_plugin *plugin = input_plugins[i]; const struct input_plugin *plugin = input_plugins[i];
assert(plugin->name != NULL);
assert(*plugin->name != 0);
assert(plugin->open != NULL);
const struct config_param *param = const struct config_param *param =
input_plugin_config(plugin->name, &error); input_plugin_config(plugin->name, &error);
if (param == NULL && error != NULL) { if (param == NULL && error != NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment