aboutsummaryrefslogtreecommitdiff
path: root/src/malloc.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-05-15 04:13:15 +0000
committerdrh <drh@noemail.net>2015-05-15 04:13:15 +0000
commit22c17b8bf5c1600b488b6ce491c7bbdc0f3204d0 (patch)
tree4a9a224eca899cd0b0cbdb6478a315107164a629 /src/malloc.c
parentf922ca497dd3b72db072c63beabb97fe437a1589 (diff)
downloadsqlite-22c17b8bf5c1600b488b6ce491c7bbdc0f3204d0.tar.gz
sqlite-22c17b8bf5c1600b488b6ce491c7bbdc0f3204d0.zip
Simplifications to error message processing. Fix a possible problem in error
message formatting when vacuuming a database with a corrupt schema. FossilOrigin-Name: 56ef98a04765c34c1c2f3ed7a6f03a732f3b886e
Diffstat (limited to 'src/malloc.c')
-rw-r--r--src/malloc.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/malloc.c b/src/malloc.c
index 70b834579..1b9a20956 100644
--- a/src/malloc.c
+++ b/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);
}
/*