aboutsummaryrefslogtreecommitdiff
path: root/src/func.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2006-04-07 13:26:42 +0000
committerdrh <drh@noemail.net>2006-04-07 13:26:42 +0000
commit502b962b2df49c68c88c79b5c8c2dd70afa7527d (patch)
tree65c180d6f0f1d78694c3b130cf62fa10f5239297 /src/func.c
parentc65ff65f552fc58719f4403f72f84d90c24f941d (diff)
downloadsqlite-502b962b2df49c68c88c79b5c8c2dd70afa7527d.tar.gz
sqlite-502b962b2df49c68c88c79b5c8c2dd70afa7527d.zip
Avoid the use of atof(). Ticket #1756. (CVS 3168)
FossilOrigin-Name: 76aef93c3e113b0077f534a437a339be2b15ca3d
Diffstat (limited to 'src/func.c')
-rw-r--r--src/func.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/func.c b/src/func.c
index 73ae8f6c7..0cab2ffbd 100644
--- a/src/func.c
+++ b/src/func.c
@@ -16,7 +16,7 @@
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
** All other code has file scope.
**
-** $Id: func.c,v 1.126 2006/03/16 16:19:56 drh Exp $
+** $Id: func.c,v 1.127 2006/04/07 13:26:43 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -204,7 +204,8 @@ static void roundFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
r = sqlite3_value_double(argv[0]);
sqlite3_snprintf(sizeof(zBuf),zBuf,"%.*f",n,r);
- sqlite3_result_double(context, atof(zBuf));
+ sqlite3AtoF(zBuf, &r);
+ sqlite3_result_double(context, r);
}
/*