aboutsummaryrefslogtreecommitdiff
path: root/src/rc-plugin.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-04-06 01:04:07 +0000
committerRoy Marples <roy@marples.name>2007-04-06 01:04:07 +0000
commit657be653400bdb9fc8ab13037e51ecfbc1af9d40 (patch)
tree8e876d2a345eb56dff9b7c732a082bc00720d020 /src/rc-plugin.c
parent308042c87bd920d787265f1854bf1695bdbab8e4 (diff)
Misc fixes, plugged a memory leak in runscript.c and use va_copy to avoid nasty segfaults
Diffstat (limited to 'src/rc-plugin.c')
-rw-r--r--src/rc-plugin.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rc-plugin.c b/src/rc-plugin.c
index c02b6a81..b742eadd 100644
--- a/src/rc-plugin.c
+++ b/src/rc-plugin.c
@@ -47,6 +47,7 @@ void rc_plugin_load (void)
void *h = dlopen (p, RTLD_LAZY);
char *func;
void *f;
+ int len;
if (! h)
{
@@ -57,8 +58,9 @@ void rc_plugin_load (void)
func = file;
file = strsep (&func, ".");
- func = rc_xmalloc (strlen (file) + strlen ("__hook") + 1);
- sprintf (func, "_%s_hook", file);
+ len = strlen (file) + 7;
+ func = rc_xmalloc (sizeof (char *) * len);
+ snprintf (func, len, "_%s_hook", file);
f = dlsym (h, func);
if (! f)