aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBryan Jurish <mukau@users.sourceforge.net>2007-10-19 13:32:56 +0000
committerBryan Jurish <mukau@users.sourceforge.net>2007-10-19 13:32:56 +0000
commit36628a5c9a9610af6e3d7475d777fadee6eae496 (patch)
treec31ff48114f22c81da1d2b8aeebf5a9c3d2a7187 /src
parentc2c10b7a3b5f35b165f010c1f0c399aff90b1f5e (diff)
+ fixed any2string/string2any asymmetry for default case eos_char<0
svn path=/trunk/externals/moocow/pdstring/; revision=8841
Diffstat (limited to 'src')
-rw-r--r--src/string2any.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/string2any.c b/src/string2any.c
index a2b90dc..a79dc0e 100644
--- a/src/string2any.c
+++ b/src/string2any.c
@@ -87,7 +87,7 @@ typedef struct _string2any
static void string2any_atoms(t_string2any *x, int argc, t_atom *argv)
{
char *s;
- int x_argc, a_argc=argc;
+ int x_argc, a_argc=0;
t_atom *x_argv;
/*-- allocate --*/
@@ -98,8 +98,10 @@ static void string2any_atoms(t_string2any *x, int argc, t_atom *argv)
}
/*-- get text --*/
- for (s=x->x_text; argc > 0; argc--, argv++, s++) {
+ for (s=x->x_text; argc > 0; argc--, a_argc++, argv++, s++) {
*s = atom_getfloat(argv);
+ S2ADEBUG(post("string2any[%p]: a_argc=%d,*s=%d", x, a_argc, *s));
+ if ((x->x_eos<0 && !*s) || (*s==x->x_eos)) { break; } /*-- hack: look for eos char --*/
}
*s = 0;
S2ADEBUG(post("string2any[%p]: text: \"%s\", strlen=%d, argc=%d", x, x->x_text, strlen(x->x_text), a_argc));