Fix some problems in test code detected by cppcheck.
FossilOrigin-Name: c9ff4ca4a0b44bbb8d6676144ddf77b04426e619
This commit is contained in:
+2
-2
@@ -338,7 +338,7 @@ static int test_exec_hex(
|
||||
int rc, i, j;
|
||||
char *zErr = 0;
|
||||
char *zHex;
|
||||
char zSql[500];
|
||||
char zSql[501];
|
||||
char zBuf[30];
|
||||
if( argc!=3 ){
|
||||
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
|
||||
@@ -347,7 +347,7 @@ static int test_exec_hex(
|
||||
}
|
||||
if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR;
|
||||
zHex = argv[2];
|
||||
for(i=j=0; i<sizeof(zSql) && zHex[j]; i++, j++){
|
||||
for(i=j=0; i<(sizeof(zSql)-1) && zHex[j]; i++, j++){
|
||||
if( zHex[j]=='%' && zHex[j+2] && zHex[j+2] ){
|
||||
zSql[i] = (testHexToInt(zHex[j+1])<<4) + testHexToInt(zHex[j+2]);
|
||||
j += 2;
|
||||
|
||||
Reference in New Issue
Block a user