From 3d2d6b46bf3325c0273b35a202184ab09d38e0cd Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 25 Jul 2012 22:34:19 +0300 Subject: Start refactoring iop handling. Add readdir extension. --- ext.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext.c') diff --git a/ext.c b/ext.c index af6542d4..17ade95a 100644 --- a/ext.c +++ b/ext.c @@ -51,6 +51,9 @@ load_ext(const char *lib_name) if (do_traditional || do_posix) fatal(_("-l / @load are gawk extensions")); + if (lib_name == NULL) + fatal(_("load_ext: received NULL lib_name")); + if ((dl = dlopen(lib_name, flags)) == NULL) fatal(_("load_ext: cannot open library `%s' (%s)\n"), lib_name, dlerror()); @@ -60,6 +63,7 @@ load_ext(const char *lib_name) if (gpl_compat == NULL) fatal(_("load_ext: library `%s': does not define `plugin_is_GPL_compatible' (%s)\n"), lib_name, dlerror()); + install_func = (int (*)(const gawk_api_t *const, awk_ext_id_t)) dlsym(dl, INIT_FUNC); if (install_func == NULL) -- cgit v1.2.3