diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/list2symbol.c | 5 | ||||
-rw-r--r-- | src/makesymbol.c | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/list2symbol.c b/src/list2symbol.c index 1c77c34..50d20e8 100644 --- a/src/list2symbol.c +++ b/src/list2symbol.c @@ -47,6 +47,7 @@ static void list2symbol_bang(t_list2symbol *x) int i= argc; char *connector=0; char connlen=0; + char*buffer = (char*)getbytes(MAXPDSTRING*sizeof(char)); if(x->connector)connector=x->connector->s_name; if(connector)connlen=strlen(connector); @@ -57,7 +58,6 @@ static void list2symbol_bang(t_list2symbol *x) length+=i*connlen; while(i--){ - char buffer[MAXPDSTRING]; int len=0; if(A_SYMBOL==argv->a_type){ len=strlen(argv->a_w.w_symbol->s_name); @@ -93,7 +93,6 @@ static void list2symbol_bang(t_list2symbol *x) strcpy(result+len, argv->a_w.w_symbol->s_name); len+= strlen(argv->a_w.w_symbol->s_name); } else { - char buffer[MAXPDSTRING]; atom_string(argv, buffer, MAXPDSTRING); strcpy(result+len, buffer); len += strlen(buffer); @@ -104,6 +103,8 @@ static void list2symbol_bang(t_list2symbol *x) len += connlen; } } + freebytes(buffer, MAXPDSTRING*sizeof(char)); + result[length]=0; outlet_symbol(x->x_obj.ob_outlet, gensym(result)); freebytes(result, (length+1)*sizeof(char)); diff --git a/src/makesymbol.c b/src/makesymbol.c index 3c4ada6..e361c80 100644 --- a/src/makesymbol.c +++ b/src/makesymbol.c @@ -55,11 +55,12 @@ static void reset_mask(t_makesymbol *x, t_symbol *s) } } +typedef char cstring[MAXSTRINGLENG]; + t_symbol* list2symbol(char *masque, int argc, t_atom *argv) { - typedef char cstring[MAXSTRINGLENG]; - - cstring buf[MAXSTRINGARGS]; + // cstring buf[MAXSTRINGARGS]; + cstring*buf=(cstring*)getbytes(MAXSTRINGARGS*sizeof(cstring)); cstring buffer; int i; @@ -73,6 +74,7 @@ t_symbol* list2symbol(char *masque, int argc, t_atom *argv) masque, buf[0], buf[1], buf[2], buf[3], buf[4], buf[5], buf[6], buf[7], buf[8], buf[9]); + freebytes(buf, MAXSTRINGARGS*sizeof(cstring)); return (gensym(buffer)); } |