[Olsr-dev] [PATCH v1 064/115] info: add some asserts

Ferry Huberts (spam-protected)
Wed Dec 2 21:28:37 CET 2015


From: Ferry Huberts <(spam-protected)>

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 lib/info/olsrd_info.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lib/info/olsrd_info.c b/lib/info/olsrd_info.c
index 786572f..46f9edc 100644
--- a/lib/info/olsrd_info.c
+++ b/lib/info/olsrd_info.c
@@ -41,6 +41,7 @@
 
 #include <arpa/inet.h>
 #include <unistd.h>
+#include <assert.h>
 
 #include "olsrd_info.h"
 #include "olsr.h"
@@ -416,13 +417,16 @@ static int plugin_ipc_init(void) {
  *function in uolsrd_plugin.c
  */
 int info_plugin_init(const char * plugin_name, info_plugin_functions_t *plugin_functions, info_plugin_config_t *plugin_config) {
-  functions = plugin_functions;
+  assert(plugin_name);
+  assert(plugin_functions);
+  assert(plugin_config);
+
   name = plugin_name;
+  functions = plugin_functions;
   config = plugin_config;
 
-  /* Initial IPC value */
-  ipc_socket = -1;
   memset(&outbuffer, 0, sizeof(outbuffer));
+  ipc_socket = -1;
 
   if ((*functions).init) {
     (*(*functions).init)(name);
-- 
2.5.0




More information about the Olsr-dev mailing list