Update of /cvsroot/pure-data/externals/moocow/pdstring/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7451/src
Modified Files: any2string.c Log Message: + v0.0.4: paranoia fixes in any2string.c
Index: any2string.c =================================================================== RCS file: /cvsroot/pure-data/externals/moocow/pdstring/src/any2string.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** any2string.c 2 Feb 2006 12:46:01 -0000 1.1 --- any2string.c 24 Jul 2007 22:58:49 -0000 1.2 *************** *** 5,9 **** * Description: convert pd messages to strings * ! * Copyright (c) 2004 Bryan Jurish. * * For information on usage and redistribution, and for a DISCLAIMER OF ALL --- 5,9 ---- * Description: convert pd messages to strings * ! * Copyright (c) 2004 - 2007 Bryan Jurish. * * For information on usage and redistribution, and for a DISCLAIMER OF ALL *************** *** 38,42 **** * DEBUG *--------------------------------------------------------------------*/ ! //#define ANY2STRING_DEBUG 1
#ifdef ANY2STRING_DEBUG --- 38,42 ---- * DEBUG *--------------------------------------------------------------------*/ ! #define ANY2STRING_DEBUG 1
#ifdef ANY2STRING_DEBUG *************** *** 79,83 **** { t_atom *a; ! char *text, *s; int len;
--- 79,83 ---- { t_atom *a; ! char *text=NULL, *s, *s_max; int len;
*************** *** 89,92 **** --- 89,93 ---- A2SDEBUG(post("any2string: binbuf_add()")); binbuf_add(x->x_binbuf, argc, argv); + A2SDEBUG(startpost("any2string: binbuf_print: ")); A2SDEBUG(binbuf_print(x->x_binbuf));
*************** *** 94,98 **** binbuf_gettext(x->x_binbuf, &text, &len); A2SDEBUG(post("any2string: binbuf_gettext() = "%s" ; len=%d", text, len)); ! text[len] = 0;
/*-- get string length --*/ --- 95,99 ---- binbuf_gettext(x->x_binbuf, &text, &len); A2SDEBUG(post("any2string: binbuf_gettext() = "%s" ; len=%d", text, len)); ! /*text[len] = 0;*/ /*-- ? avoid errors: free(): invalid next size(fast): [HEX_ADDRESS] */
/*-- get string length --*/ *************** *** 112,116 **** }
! /*-- add selector --*/ a=x->x_argv; if (sel != &s_float && sel != &s_list && sel != &s_) { --- 113,117 ---- }
! /*-- add selector (maybe) --*/ a=x->x_argv; if (sel != &s_float && sel != &s_list && sel != &s_) { *************** *** 130,134 **** /*-- add binbuf text --*/ A2SDEBUG(post("any2string: for {...}")); ! for (s=text; *s; s++, a++) { A2SDEBUG(post("any2string: for: //SETFLOAT(a,'%c'=%d)", *s, *s)); SETFLOAT(a,*s); --- 131,136 ---- /*-- add binbuf text --*/ A2SDEBUG(post("any2string: for {...}")); ! s_max = text+len; ! for (s=text; s < s_max; s++, a++) { A2SDEBUG(post("any2string: for: //SETFLOAT(a,'%c'=%d)", *s, *s)); SETFLOAT(a,*s); *************** *** 140,144 ****
A2SDEBUG(post("any2string: freebytes()")); ! freebytes(text, strlen(text));
/* --- 142,146 ----
A2SDEBUG(post("any2string: freebytes()")); ! freebytes(text, len);
/*