Branch: Tag:

1998-05-15

1998-05-15 18:38:49 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added some paranoia.

Rev: src/dynamic_load.c:1.27

7:   # include "stralloc.h"   # include "pike_macros.h"    - RCSID("$Id: dynamic_load.c,v 1.26 1998/04/17 00:15:01 grubba Exp $"); + RCSID("$Id: dynamic_load.c,v 1.27 1998/05/15 18:38:49 grubba Exp $");      #endif   
168: Inside #if undefined(TESTING) and #if defined(HAVE_DLOPEN) || defined(USE_DLD)
   {    const char *err = dlerror();    if(!err) err = "Unknown reason"; +  if (sp[-args].u.string->len < 1024) {    error("load_module(\"%s\") failed: %s\n",    sp[-args].u.string->str, err); -  +  } else { +  error("load_module() failed: %s\n", err);    } -  +  }       init=(modfun)dlsym(module, "pike_module_init");    if (!init) {
185: Inside #if undefined(TESTING) and #if defined(HAVE_DLOPEN) || defined(USE_DLD)
   {    dlclose(module);    -  error("Failed to initialize module \"%s\".\n", module_name); +  if (sizeof(module_name) < 1024) { +  error("Failed to initialize dynamic module \"%s\".\n", module_name); +  } else { +  error("Failed to initialize dynamic module.\n");    } -  +  }       new_module=ALLOC_STRUCT(module_list);    new_module->next=dynamic_module_list;