diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 10 | ||||
-rw-r--r-- | src/printf.c | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c index 261fadf16..803c0ec4b 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.444 2008/06/14 16:56:22 drh Exp $ +** $Id: main.c,v 1.445 2008/06/16 20:51:16 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -1554,7 +1554,7 @@ int sqlite3_table_column_metadata( char const **pzCollSeq, /* OUTPUT: Collation sequence name */ int *pNotNull, /* OUTPUT: True if NOT NULL constraint exists */ int *pPrimaryKey, /* OUTPUT: True if column part of PK */ - int *pAutoinc /* OUTPUT: True if colums is auto-increment */ + int *pAutoinc /* OUTPUT: True if column is auto-increment */ ){ int rc; char *zErrMsg = 0; @@ -1617,9 +1617,9 @@ int sqlite3_table_column_metadata( if( pCol ){ zDataType = pCol->zType; zCollSeq = pCol->zColl; - notnull = (pCol->notNull?1:0); - primarykey = (pCol->isPrimKey?1:0); - autoinc = ((pTab->iPKey==iCol && pTab->autoInc)?1:0); + notnull = pCol->notNull!=0; + primarykey = pCol->isPrimKey!=0; + autoinc = pTab->iPKey==iCol && pTab->autoInc; }else{ zDataType = "INTEGER"; primarykey = 1; diff --git a/src/printf.c b/src/printf.c index d0b219a41..dc8d71105 100644 --- a/src/printf.c +++ b/src/printf.c @@ -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.86 2008/06/15 02:51:48 drh Exp $ +** $Id: printf.c,v 1.87 2008/06/16 20:51:16 drh Exp $ ** ************************************************************************** ** @@ -850,6 +850,7 @@ char *sqlite3_vmprintf(const char *zFormat, va_list ap){ char *z; char zBase[SQLITE_PRINT_BUF_SIZE]; StrAccum acc; + sqlite3_initialize(); sqlite3StrAccumInit(&acc, zBase, sizeof(zBase), SQLITE_MAX_LENGTH); vxprintf(&acc, 0, zFormat, ap); z = sqlite3StrAccumFinish(&acc); @@ -863,6 +864,7 @@ char *sqlite3_vmprintf(const char *zFormat, va_list ap){ char *sqlite3_mprintf(const char *zFormat, ...){ va_list ap; char *z; + sqlite3_initialize(); va_start(ap, zFormat); z = sqlite3_vmprintf(zFormat, ap); va_end(ap); |