/[baselayout]/trunk/src/rc-plugin.c
Gentoo

Diff of /trunk/src/rc-plugin.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 2549 Revision 2550
45 { 45 {
46 char *p = rc_strcatpaths (RC_PLUGINDIR, file, NULL); 46 char *p = rc_strcatpaths (RC_PLUGINDIR, file, NULL);
47 void *h = dlopen (p, RTLD_LAZY); 47 void *h = dlopen (p, RTLD_LAZY);
48 char *func; 48 char *func;
49 void *f; 49 void *f;
50 int len;
50 51
51 if (! h) 52 if (! h)
52 { 53 {
53 eerror ("dlopen `%s': %s", p, dlerror ()); 54 eerror ("dlopen `%s': %s", p, dlerror ());
54 free (p); 55 free (p);
55 continue; 56 continue;
56 } 57 }
57 58
58 func = file; 59 func = file;
59 file = strsep (&func, "."); 60 file = strsep (&func, ".");
60 func = rc_xmalloc (strlen (file) + strlen ("__hook") + 1); 61 len = strlen (file) + 7;
62 func = rc_xmalloc (sizeof (char *) * len);
61 sprintf (func, "_%s_hook", file); 63 snprintf (func, len, "_%s_hook", file);
62 64
63 f = dlsym (h, func); 65 f = dlsym (h, func);
64 if (! f) 66 if (! f)
65 { 67 {
66 eerror ("`%s' does not expose the symbol `%s'", p, func); 68 eerror ("`%s' does not expose the symbol `%s'", p, func);

Legend:
Removed from v.2549  
changed lines
  Added in v.2550

  ViewVC Help
Powered by ViewVC 1.1.20