From f17b14102c0741795729a17a3a4fad9e208323b6 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 8 Jan 2012 10:26:36 +0000 Subject: [PATCH] bug fix, incorrect '%le' printf format specifier --- ChangeLog | 14 ++++++++++++++ src/frontend/numparam/xpressn.c | 2 +- src/maths/poly/polyfit.c | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c6aaae251..7732c52f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2012-01-08 Robert Larice + * src/frontend/numparam/xpressn.c , + * src/maths/poly/polyfit.c : + bug fix, incorrect '%le' printf format specifier + + responsible for failure on mingw. see + string parameters cause crash on win32 platform - ID: 3469699 + http://sourceforge.net/tracker/?func=detail&atid=423915&group_id=38962&aid=3469699 + + I've sneaked this in with commit + "numparm, 17 digit placeholders --> numparm__XXXXXXXX dummy symbols" + from + 2011-02-19 Robert Larice + 2012-01-07 Robert Larice * src/spicelib/devices/bsim1/b1set.c , * src/spicelib/devices/bsim2/b2set.c , diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index c4625e6d6..843254776 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -1399,7 +1399,7 @@ evaluate (tdico * dico, SPICE_DSTRINGPTR qstr_p, char *t, unsigned char mode) */ char buf[17+1]; - if(snprintf(buf, sizeof(buf), "% 17.9le", u) != 17) { + if(snprintf(buf, sizeof(buf), "% 17.9e", u) != 17) { fprintf(stderr, "ERROR: xpressn.c, %s(%d)\n", __FUNCTION__, __LINE__); controlled_exit(1); } diff --git a/src/maths/poly/polyfit.c b/src/maths/poly/polyfit.c index 2c9d457bf..0f9bbc189 100644 --- a/src/maths/poly/polyfit.c +++ b/src/maths/poly/polyfit.c @@ -93,7 +93,7 @@ ft_polyfit(double *xdata, double *ydata, double *result, if (fabs(d - ydata[i]) > ABS_TOL) { /* fprintf(cp_err, - "Error: polyfit: x = %le, y = %le, int = %le\n", + "Error: polyfit: x = %e, y = %le, int = %e\n", xdata[i], ydata[i], d); printmat("mat1", mat1, n, n); printmat("mat2", mat2, n, 1); @@ -103,7 +103,7 @@ ft_polyfit(double *xdata, double *ydata, double *result, ABS_TOL) > REL_TOL) { /* fprintf(cp_err, - "Error: polyfit: x = %le, y = %le, int = %le\n", + "Error: polyfit: x = %e, y = %le, int = %e\n", xdata[i], ydata[i], d); printmat("mat1", mat1, n, n); printmat("mat2", mat2, n, 1);