1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Simplifications to error message processing. Fix a possible problem in error

message formatting when vacuuming a database with a corrupt schema.

FossilOrigin-Name: 56ef98a04765c34c1c2f3ed7a6f03a732f3b886e
This commit is contained in:
drh
2015-05-15 04:13:15 +00:00
parent f922ca497d
commit 22c17b8bf5
11 changed files with 72 additions and 90 deletions

View File

@@ -771,19 +771,11 @@ char *sqlite3DbStrNDup(sqlite3 *db, const char *z, u64 n){
}
/*
** Create a string from the zFromat argument and the va_list that follows.
** Store the string in memory obtained from sqliteMalloc() and make *pz
** point to that string.
** Free any prior content in *pz and replace it with a copy of zNew.
*/
void sqlite3SetString(char **pz, sqlite3 *db, const char *zFormat, ...){
va_list ap;
char *z;
va_start(ap, zFormat);
z = sqlite3VMPrintf(db, zFormat, ap);
va_end(ap);
void sqlite3SetString(char **pz, sqlite3 *db, const char *zNew){
sqlite3DbFree(db, *pz);
*pz = z;
*pz = sqlite3DbStrDup(db, zNew);
}
/*