1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-24 09:53:10 +03:00

Use the internal sqlite3_snprintf function instead of sprintf to avoid

cross-platform incompatibilities.  Ticket #1316. (CVS 2545)

FossilOrigin-Name: 431999da7bf0079e0d514483b3bfd9f8471cba7d
This commit is contained in:
drh
2005-07-09 02:38:06 +00:00
parent df3816974c
commit e866fcb923
3 changed files with 9 additions and 9 deletions

View File

@@ -16,7 +16,7 @@
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: func.c,v 1.101 2005/07/08 13:53:22 drh Exp $
** $Id: func.c,v 1.102 2005/07/09 02:38:06 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -194,7 +194,7 @@ static void roundFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
}
if( SQLITE_NULL==sqlite3_value_type(argv[0]) ) return;
r = sqlite3_value_double(argv[0]);
sprintf(zBuf,"%.*f",n,r);
sqlite3_snprintf(sizeof(zBuf),zBuf,"%.*f",n,r);
sqlite3_result_text(context, zBuf, -1, SQLITE_TRANSIENT);
}