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/build.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/build.c')
-rw-r--r-- | src/build.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/build.c b/src/build.c index 30037e3fa..1cff08b1f 100644 --- a/src/build.c +++ b/src/build.c @@ -22,7 +22,7 @@ ** COMMIT ** ROLLBACK ** -** $Id: build.c,v 1.487 2008/07/08 14:52:08 drh Exp $ +** $Id: build.c,v 1.488 2008/07/08 19:34:07 drh Exp $ */ #include "sqliteInt.h" #include <ctype.h> @@ -2458,15 +2458,11 @@ void sqlite3CreateIndex( goto exit_create_index; } }else{ - char zBuf[30]; int n; Index *pLoop; for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){} - sqlite3_snprintf(sizeof(zBuf),zBuf,"_%d",n); - zName = 0; - sqlite3SetString(&zName, "sqlite_autoindex_", pTab->zName, zBuf, (char*)0); + zName = sqlite3MPrintf(db, "sqlite_autoindex_%s_%d", pTab->zName, n); if( zName==0 ){ - db->mallocFailed = 1; goto exit_create_index; } } |