Code

Include config.h in source files.
[sysdb.git] / src / core / plugin.c
index 46976d01f7435c580e088f3aebd7836ad14ebbf4..559e6eb4d7db1aa803a55783025d2dc4a8ee6afb 100644 (file)
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#if HAVE_CONFIG_H
+#      include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include "sysdb.h"
 #include "core/plugin.h"
 #include "core/time.h"
@@ -386,7 +390,7 @@ plugin_add_callback(sdb_llist_t **list, const char *type,
 int
 sdb_plugin_load(const char *name, const sdb_plugin_ctx_t *plugin_ctx)
 {
-       char  real_name[strlen(name) > 0 ? strlen(name) : 1];
+       char  real_name[name ? strlen(name) + 1 : 1];
        const char *name_ptr;
        char *tmp;