mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Eliminate all uses of sprintf() and strcpy(). These were not being
misused. But getting rid of them removes a library dependency. And it avoids warnings from the OpenBSD compiler. Ticket #2336. (CVS 3916) FossilOrigin-Name: ba4845b32bdf38e623c4f7246e6e327715bbba4b
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
** other files are for internal use by SQLite and should not be
|
||||
** accessed by users of the library.
|
||||
**
|
||||
** $Id: legacy.c,v 1.17 2007/04/25 11:28:17 drh Exp $
|
||||
** $Id: legacy.c,v 1.18 2007/05/04 13:15:56 drh Exp $
|
||||
*/
|
||||
|
||||
#include "sqliteInt.h"
|
||||
@@ -118,9 +118,10 @@ exec_out:
|
||||
|
||||
rc = sqlite3ApiExit(0, rc);
|
||||
if( rc!=SQLITE_OK && rc==sqlite3_errcode(db) && pzErrMsg ){
|
||||
*pzErrMsg = sqlite3_malloc(1+strlen(sqlite3_errmsg(db)));
|
||||
int nErrMsg = 1 + strlen(sqlite3_errmsg(db));
|
||||
*pzErrMsg = sqlite3_malloc(nErrMsg);
|
||||
if( *pzErrMsg ){
|
||||
strcpy(*pzErrMsg, sqlite3_errmsg(db));
|
||||
memcpy(*pzErrMsg, sqlite3_errmsg(db), nErrMsg);
|
||||
}
|
||||
}else if( pzErrMsg ){
|
||||
*pzErrMsg = 0;
|
||||
|
||||
Reference in New Issue
Block a user