[Scipy-svn] r2804 - trunk/Lib/sandbox/timeseries/src

scipy-svn at scipy.org scipy-svn at scipy.org
Thu Mar 1 16:39:34 EST 2007


Author: mattknox_ca
Date: 2007-03-01 15:39:24 -0600 (Thu, 01 Mar 2007)
New Revision: 2804

Modified:
   trunk/Lib/sandbox/timeseries/src/cseries.c
Log:
fixed segfault error in strfmt

Modified: trunk/Lib/sandbox/timeseries/src/cseries.c
===================================================================
--- trunk/Lib/sandbox/timeseries/src/cseries.c	2007-03-01 21:31:03 UTC (rev 2803)
+++ trunk/Lib/sandbox/timeseries/src/cseries.c	2007-03-01 21:39:24 UTC (rev 2804)
@@ -1397,7 +1397,7 @@
 
     /* We need to modify the fmt_str passed in to handle our special syntax for quarters.
        We can't modify the string passed in directly, so we must make a copy. */
-    fmt_str = malloc(strlen(orig_fmt_str)*sizeof(char));
+    fmt_str = malloc((strlen(orig_fmt_str) + 1)*sizeof(char));
     strcpy(fmt_str, orig_fmt_str);
 
     if ((q_loc = strstr(fmt_str,"%q")) != NULL) {




More information about the Scipy-svn mailing list