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:
14
src/malloc.c
14
src/malloc.c
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user