mirror of
https://github.com/sqlite/sqlite.git
synced 2025-10-24 09:53:10 +03:00
Test functions tolerate an "0x" before a pointer value. Ticket #452. (CVS 1145)
FossilOrigin-Name: c6c5e07b65ae1c30117f0276a1002d5036697cf1
This commit is contained in:
10
src/test1.c
10
src/test1.c
@@ -13,7 +13,7 @@
|
||||
** is not included in the SQLite library. It is used for automated
|
||||
** testing of the SQLite library.
|
||||
**
|
||||
** $Id: test1.c,v 1.29 2003/12/23 02:17:35 drh Exp $
|
||||
** $Id: test1.c,v 1.30 2003/12/23 03:06:23 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "tcl.h"
|
||||
@@ -30,9 +30,11 @@
|
||||
/*
|
||||
** Decode a pointer to an sqlite object.
|
||||
*/
|
||||
static int getDbPointer(Tcl_Interp *interp, const char *zArg, sqlite **ppDb){
|
||||
if( sscanf(zArg, PTR_FMT, (void**)ppDb)!=1 ){
|
||||
Tcl_AppendResult(interp, "\"", zArg, "\" is not a valid pointer value", 0);
|
||||
static int getDbPointer(Tcl_Interp *interp, const char *zA, sqlite **ppDb){
|
||||
if( sscanf(zA, PTR_FMT, (void**)ppDb)!=1 &&
|
||||
(zA[0]!='0' || zA[1]!='x' || sscanf(&zA[2], PTR_FMT, (void**)ppDb)!=1)
|
||||
){
|
||||
Tcl_AppendResult(interp, "\"", zA, "\" is not a valid pointer value", 0);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
return TCL_OK;
|
||||
|
||||
Reference in New Issue
Block a user