[Rcpp-commits] r2767 - in pkg/Rcpp: . inst/include/Rcpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Dec 10 21:08:20 CET 2010


Author: edd
Date: 2010-12-10 21:08:19 +0100 (Fri, 10 Dec 2010)
New Revision: 2767

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/include/Rcpp/sprintf.h
Log:
use vsnprintf


Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2010-12-10 16:01:07 UTC (rev 2766)
+++ pkg/Rcpp/ChangeLog	2010-12-10 20:08:19 UTC (rev 2767)
@@ -1,10 +1,14 @@
+2010-12-10  Dirk Eddelbuettel  <edd at debian.org>
+
+	* inst/include/Rcpp/sprintf.h: Use vsnprintf() instead
+
 2010-12-10  Romain Francois <romain at r-enthusiasts.com>
 
-    * inst/include/Rcpp/barrier.h: faster versions (crossing the write barrier)
-    for string_elt, etc ...(to be used only internally)
-    
-    * src/barrier.cpp: implementation of the above
-    
+	* inst/include/Rcpp/barrier.h: faster versions (crossing the write
+	barrier) for string_elt, etc ...(to be used only internally)
+
+	* src/barrier.cpp: implementation of the above
+
 2010-12-09  John M Chambers  <jmc at r-project.org>
 
 	* src/Module.cpp: Rcpp/src/exceptions.cpp,

Modified: pkg/Rcpp/inst/include/Rcpp/sprintf.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sprintf.h	2010-12-10 16:01:07 UTC (rev 2766)
+++ pkg/Rcpp/inst/include/Rcpp/sprintf.h	2010-12-10 20:08:19 UTC (rev 2767)
@@ -29,9 +29,8 @@
     static char buffer[MAX_SIZE]; 
     va_list(ap);
     va_start(ap, format);
-    vsprintf( buffer, format, ap);
+    vsnprintf( buffer, MAX_SIZE, format, ap);
     va_end(ap);
-    buffer[MAX_SIZE] = '\0';
     return strdup( buffer ) ;
 }
 



More information about the Rcpp-commits mailing list