Update of /cvsroot/pure-data/externals/zexy/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27629
Modified Files: msgfile.c Log Message: fixed crasher bug when replacing an sublist in an empty msgbox
Index: msgfile.c =================================================================== RCS file: /cvsroot/pure-data/externals/zexy/src/msgfile.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** msgfile.c 14 Mar 2007 09:08:56 -0000 1.18 --- msgfile.c 6 Sep 2007 08:31:08 -0000 1.19 *************** *** 64,68 **** int mode;
- t_msglist *current; /* pointer to our list */
--- 64,67 ---- *************** *** 119,130 **** t_msglist *nxt=dummy->next; t_msglist *prv=dummy->previous; ! freebytes(dummy->thislist, sizeof(dummy->thislist)); ! dummy->thislist = 0; ! dummy->n = 0; ! dummy->next=0; ! dummy->previous=0;
! freebytes(dummy, sizeof(t_msglist)); ! dummy=0;
if (nxt) nxt->previous = prv; --- 118,131 ---- t_msglist *nxt=dummy->next; t_msglist *prv=dummy->previous; ! if(dummy){ ! freebytes(dummy->thislist, sizeof(dummy->thislist)); ! dummy->thislist = 0; ! dummy->n = 0; ! dummy->next=0; ! dummy->previous=0;
! freebytes(dummy, sizeof(t_msglist)); ! dummy=0; ! }
if (nxt) nxt->previous = prv; *************** *** 356,362 **** static void msgfile_replace(t_msgfile *x, t_symbol *s, int ac, t_atom *av) { ! freebytes(x->current->thislist, sizeof(x->current->thislist)); ! x->current->thislist = 0; ! x->current->n = 0; write_currentnode(x, ac, av); } --- 357,369 ---- static void msgfile_replace(t_msgfile *x, t_symbol *s, int ac, t_atom *av) { ! if(x->current) { ! if(x->current->thislist) { ! freebytes(x->current->thislist, sizeof(x->current->thislist)); ! } ! x->current->thislist = 0; ! x->current->n = 0; ! } else { ! add_currentnode(x); ! } write_currentnode(x, ac, av); }