diff --git a/extra/pd~/pd~.c b/extra/pd~/pd~.c index 06de586b730df577ae9eb02f0f2f49b6805279d3..6dae70a60794625d57e0764b3741459c021ed5d2 100644 --- a/extra/pd~/pd~.c +++ b/extra/pd~/pd~.c @@ -656,8 +656,8 @@ static void *pd_tilde_new(t_symbol *s, long ac, t_atom *av) char *pds = pddir->s_name; int l = strlen(pds); if (l >= 4 && (!strcmp(pds+l-3, "bin") || !strcmp(pds+l-4, "bin/"))) - snprintf(pdargstring, MAXPDSTRING, "%s/../extra/pd~"); - else snprintf(pdargstring, MAXPDSTRING, "%s/extra/pd~"); + snprintf(pdargstring, MAXPDSTRING, "%s/../extra/pd~", pds); + else snprintf(pdargstring, MAXPDSTRING, "%s/extra/pd~", pds); scheddir = gensym(pdargstring); } pdargstring[0] = 0; @@ -665,7 +665,7 @@ static void *pd_tilde_new(t_symbol *s, long ac, t_atom *av) { char buf[80]; if (av->a_type == A_SYM) - strncat(pdargstring, MAXPDSTRING - strlen(pdargstring)-3, av->a_w.w_sym->s_name); + strncat(pdargstring, av->a_w.w_sym->s_name, MAXPDSTRING - strlen(pdargstring)-3); else if (av->a_type == A_LONG) snprintf(buf+strlen(buf), MAXPDSTRING - strlen(pdargstring)-3, "%ld", av->a_w.w_long); else if (av->a_type == A_FLOAT)