Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15138
Modified Files: Tag: desiredata desire.c Log Message: removed some MAXPDSTRING
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.162 retrieving revision 1.1.2.217.2.163 diff -C2 -d -r1.1.2.217.2.162 -r1.1.2.217.2.163 *** desire.c 18 Jul 2007 16:33:34 -0000 1.1.2.217.2.162 --- desire.c 18 Jul 2007 18:11:40 -0000 1.1.2.217.2.163 *************** *** 7460,7471 **** else if (sys_printtostderr) fprintf(stderr, "%s", s); else { ! char t[MAXPDSTRING*2]; ! int j=0; ! for(int i=0; s[i] && j<MAXPDSTRING; i++) { ! if (strchr("\"[]$\n",s[i])) t[j++]='\'; ! t[j++] = s[i]=='\n' ? 'n' : s[i]; } ! t[j] = 0; ! sys_vgui("pdtk_post "%s"\n",t); } } --- 7460,7469 ---- else if (sys_printtostderr) fprintf(stderr, "%s", s); else { ! std::ostringstream t; ! for(int i=0; s[i]; i++) { ! if (strchr("\"[]$\n",s[i])) t << '\'; ! t << char(s[i]=='\n' ? 'n' : s[i]); } ! sys_vgui("pdtk_post "%s"\n",t.str().data()); } } *************** *** 7512,7516 ****
void verbose(int level, const char *fmt, ...) { ! char buf[MAXPDSTRING]; va_list ap; if (level>sys_verbose) return; --- 7510,7514 ----
void verbose(int level, const char *fmt, ...) { ! char *buf; va_list ap; if (level>sys_verbose) return; *************** *** 7519,7526 **** dopost("):"); va_start(ap, fmt); ! vsnprintf(buf, MAXPDSTRING-1, fmt, ap); va_end(ap); - strcat(buf, "\n"); dopost(buf); }
--- 7517,7524 ---- dopost("):"); va_start(ap, fmt); ! vasprintf(&buf,fmt,ap); va_end(ap); dopost(buf); + dopost("\n"); }
*************** *** 7537,7548 ****
void bug(const char *fmt, ...) { ! char buf[MAXPDSTRING]; va_list ap; dopost("consistency check failed: "); va_start(ap, fmt); ! vsnprintf(buf, MAXPDSTRING-1, fmt, ap); va_end(ap); - strcat(buf, "\n"); dopost(buf); }
--- 7535,7547 ----
void bug(const char *fmt, ...) { ! char *buf; va_list ap; dopost("consistency check failed: "); va_start(ap, fmt); ! vasprintf(&buf,fmt,ap); va_end(ap); dopost(buf); + free(buf); + dopost("\n"); }