diff options
author | drh <drh@noemail.net> | 2008-07-08 19:34:06 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2008-07-08 19:34:06 +0000 |
commit | f089aa459e97f6f8ed27efdc958e8ee642b0b4bb (patch) | |
tree | 345a713531ba65de2f6888ed1b76fafd5fb1dda8 /src/main.c | |
parent | 0880a7463364f3fd0428c8457c89c5fefae977ea (diff) | |
download | sqlite-f089aa459e97f6f8ed27efdc958e8ee642b0b4bb.tar.gz sqlite-f089aa459e97f6f8ed27efdc958e8ee642b0b4bb.zip |
Completely rework the sqlite3SetString() primitive so that it honors the
SQLITE_LIMIT_LENGTH and avoids the use of strlen(). (CVS 5374)
FossilOrigin-Name: 8ed04b1e26a55306e4baf3e93fb084514134d603
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c index 74e8aa90c..2f31aa535 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.471 2008/07/08 14:52:10 drh Exp $ +** $Id: main.c,v 1.472 2008/07/08 19:34:07 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -1737,8 +1737,9 @@ error_out: if( pAutoinc ) *pAutoinc = autoinc; if( SQLITE_OK==rc && !pTab ){ - sqlite3SetString(&zErrMsg, "no such table column: ", zTableName, ".", - zColumnName, 0); + sqlite3_free(zErrMsg); + zErrMsg = sqlite3MPrintf("no such table column: %s.%s", zTableName, + zColumnName); rc = SQLITE_ERROR; } sqlite3Error(db, rc, (zErrMsg?"%s":0), zErrMsg); |