input_init: add assertions on completeness of plugins
This commit is contained in:
parent
cf696ce443
commit
5184008812
|
@ -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)
|
||||||
|
|
||||||
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) {
|
||||||
|
|
Loading…
Reference in New Issue