Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12284
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.137 retrieving revision 1.1.2.217.2.138 diff -C2 -d -r1.1.2.217.2.137 -r1.1.2.217.2.138 *** desire.c 28 Jun 2007 06:41:23 -0000 1.1.2.217.2.137 --- desire.c 28 Jun 2007 07:31:08 -0000 1.1.2.217.2.138 *************** *** 7184,7190 **** i++; } else if (argc>i+1 && !strcmp(flag, "-stdpath")) { ! strncpy(strbuf, sys_libdir->name, MAXPDSTRING-3); ! strbuf[MAXPDSTRING-4] = 0; ! strcat(strbuf, "/"); strncpy(strbuf, atom_getsymbolarg(i+1, argc, argv)->name, MAXPDSTRING-strlen(strbuf)); strbuf[MAXPDSTRING-1] = 0; --- 7184,7188 ---- i++; } else if (argc>i+1 && !strcmp(flag, "-stdpath")) { ! sprintf(strbuf, "%*s/", MAXPDSTRING-3, sys_libdir->name); strncpy(strbuf, atom_getsymbolarg(i+1, argc, argv)->name, MAXPDSTRING-strlen(strbuf)); strbuf[MAXPDSTRING-1] = 0; *************** *** 7196,7202 **** i++; } else if (argc>i+1 && !strcmp(flag, "-stdlib")) { ! strncpy(strbuf, sys_libdir->name, MAXPDSTRING-3); ! strbuf[MAXPDSTRING-4] = 0; ! strcat(strbuf, "/"); strncpy(strbuf, atom_getsymbolarg(i+1, argc, argv)->name, MAXPDSTRING-strlen(strbuf)); strbuf[MAXPDSTRING-1] = 0; --- 7194,7198 ---- i++; } else if (argc>i+1 && !strcmp(flag, "-stdlib")) { ! sprintf(strbuf, "%*s/", MAXPDSTRING-3, sys_libdir->name); strncpy(strbuf, atom_getsymbolarg(i+1, argc, argv)->name, MAXPDSTRING-strlen(strbuf)); strbuf[MAXPDSTRING-1] = 0; *************** *** 7233,7239 **** for (t_namelist *nl = y->env->path; nl; nl = nl->nl_next) { char realname[MAXPDSTRING]; ! strncpy(realname, dir, MAXPDSTRING); ! realname[MAXPDSTRING-3] = 0; ! strcat(realname, "/"); strncat(realname, nl->nl_string, MAXPDSTRING-strlen(realname)); realname[MAXPDSTRING-1] = 0; --- 7229,7233 ---- for (t_namelist *nl = y->env->path; nl; nl = nl->nl_next) { char realname[MAXPDSTRING]; ! sprintf(realname, "%*s/", MAXPDSTRING-3, dir); strncat(realname, nl->nl_string, MAXPDSTRING-strlen(realname)); realname[MAXPDSTRING-1] = 0; *************** *** 7356,7360 ****
void glob_help(t_pd *bogus, t_symbol *s) { - char namebuf[MAXPDSTRING], *dir; t_class *c = class_find(s); if (!c) { --- 7350,7353 ---- *************** *** 7368,7373 **** pd_free(newest); } strcpy(namebuf, class_gethelpname(c)); ! dir = c->externdir->name; if (strcmp(namebuf + strlen(namebuf) - 3, ".pd")) strcat(namebuf, ".pd"); open_via_helppath(namebuf, dir); --- 7361,7367 ---- pd_free(newest); } + char namebuf[MAXPDSTRING]; strcpy(namebuf, class_gethelpname(c)); ! char *dir = c->externdir->name; if (strcmp(namebuf + strlen(namebuf) - 3, ".pd")) strcat(namebuf, ".pd"); open_via_helppath(namebuf, dir); *************** *** 7752,7758 **** else if (sys_printtostderr) fprintf(stderr, "%s", s); else { ! char t[MAXPDSTRING]; int j=0; ! for(int i=0; s[i] && j<MAXPDSTRING-16; i++) { if (strchr("\"[]$\n",s[i])) t[j++]='\'; t[j++] = s[i]=='\n' ? 'n' : s[i]; --- 7746,7752 ---- 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]; *************** *** 7764,7773 ****
void post(const char *fmt, ...) { ! char buf[MAXPDSTRING]; va_list ap; va_start(ap, fmt); ! vsnprintf(buf, MAXPDSTRING-1, fmt, ap); va_end(ap); strcat(buf, "\n"); dopost(buf); } void startpost(const char *fmt, ...) { ! char buf[MAXPDSTRING]; va_list ap; va_start(ap, fmt); ! vsnprintf(buf, MAXPDSTRING-1, fmt, ap); va_end(ap); dopost(buf); }
--- 7758,7767 ----
void post(const char *fmt, ...) { ! char *buf; va_list ap; va_start(ap, fmt); ! vasprintf(&buf, fmt, ap); va_end(ap); strcat(buf, "\n"); dopost(buf); } void startpost(const char *fmt, ...) { ! char *buf; va_list ap; va_start(ap, fmt); ! vasprintf(&buf, fmt, ap); va_end(ap); dopost(buf); }