[PD-cvs] pd/src desire.c,1.1.2.217.2.141,1.1.2.217.2.142

Mathieu Bouchard matju at users.sourceforge.net
Sat Jun 30 17:04:12 CEST 2007


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28253

Modified Files:
      Tag: desiredata
	desire.c 
Log Message:
fixed bug when using vasprintf() for post()


Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.141
retrieving revision 1.1.2.217.2.142
diff -C2 -d -r1.1.2.217.2.141 -r1.1.2.217.2.142
*** desire.c	28 Jun 2007 16:49:49 -0000	1.1.2.217.2.141
--- desire.c	30 Jun 2007 15:04:07 -0000	1.1.2.217.2.142
***************
*** 7758,7766 ****
  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); free(buf);
  }
  void startpost(const char *fmt, ...) {
      char *buf; va_list ap; va_start(ap, fmt);
!     vasprintf(&buf, fmt, ap); va_end(ap);                    dopost(buf); free(buf);
  }
  
--- 7758,7769 ----
  void      post(const char *fmt, ...) {
      char *buf; va_list ap; va_start(ap, fmt);
!     size_t n = vasprintf(&buf, fmt, ap); va_end(ap);
!     buf=(char*)realloc(buf,n+2); strcpy(buf+n,"\n");
!     dopost(buf); free(buf);
  }
  void startpost(const char *fmt, ...) {
      char *buf; va_list ap; va_start(ap, fmt);
!     vasprintf(&buf, fmt, ap); va_end(ap);
!     dopost(buf); free(buf);
  }
  
***************
*** 7820,7824 ****
      char buf[MAXPDSTRING];
      va_list ap;
-     static int saidit;
      dopost("error: ");
      va_start(ap, fmt);
--- 7823,7826 ----
***************
*** 7829,7836 ****
      strcpy(error_string,buf);
      error_object = (t_pd *)object;
-     if (!saidit) {
-         post("... you might be able to track this down from the Find menu.");
-         saidit = 1;
-     }
  }
  
--- 7831,7834 ----





More information about the Pd-cvs mailing list