1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Write sqlite3_initialize() calls in sqlite3_malloc() within

SQLITE_OMIT_AUTOINIT.  Ticket #3217. (CVS 5408)

FossilOrigin-Name: 4961b0bbe8b9cf5fb27de7f2514e8ab399a00134
This commit is contained in:
drh
2008-07-14 12:52:53 +00:00
parent 7986a71a19
commit ff1590ee00
4 changed files with 18 additions and 14 deletions

View File

@@ -5,7 +5,7 @@
** an historical reference. Most of the "enhancements" have been backed
** out so that the functionality is now the same as standard printf().
**
** $Id: printf.c,v 1.90 2008/07/10 00:32:42 drh Exp $
** $Id: printf.c,v 1.91 2008/07/14 12:52:53 drh Exp $
**
**************************************************************************
**
@@ -844,7 +844,9 @@ char *sqlite3_vmprintf(const char *zFormat, va_list ap){
char *z;
char zBase[SQLITE_PRINT_BUF_SIZE];
StrAccum acc;
sqlite3_initialize();
#ifndef SQLITE_OMIT_AUTOINIT
if( sqlite3_initialize() ) return 0;
#endif
sqlite3StrAccumInit(&acc, zBase, sizeof(zBase), SQLITE_MAX_LENGTH);
sqlite3VXPrintf(&acc, 0, zFormat, ap);
z = sqlite3StrAccumFinish(&acc);
@@ -858,7 +860,9 @@ char *sqlite3_vmprintf(const char *zFormat, va_list ap){
char *sqlite3_mprintf(const char *zFormat, ...){
va_list ap;
char *z;
sqlite3_initialize();
#ifndef SQLITE_OMIT_AUTOINIT
if( sqlite3_initialize() ) return 0;
#endif
va_start(ap, zFormat);
z = sqlite3_vmprintf(zFormat, ap);
va_end(ap);