aboutsummaryrefslogtreecommitdiff
path: root/src/func.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-02-19 18:29:07 +0000
committerdrh <drh@noemail.net>2008-02-19 18:29:07 +0000
commit7694574abdb2e6730f86b70e5337b9893189b5a8 (patch)
tree23257b2eb58bc3a133ec57bb837ca30b589d3bbc /src/func.c
parent85e5f0d47756b120814a46ac2ffd51017d4c4b45 (diff)
downloadsqlite-7694574abdb2e6730f86b70e5337b9893189b5a8.tar.gz
sqlite-7694574abdb2e6730f86b70e5337b9893189b5a8.zip
Remove instances of strcpy() from test code. Use memcpy() or
sqlite3_snprintf() instead. (CVS 4801) FossilOrigin-Name: 7b50140dc0fb41a1b40c8709d96e214d98b06f81
Diffstat (limited to 'src/func.c')
-rw-r--r--src/func.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/func.c b/src/func.c
index 840254b7e..9a4591ad2 100644
--- a/src/func.c
+++ b/src/func.c
@@ -16,7 +16,7 @@
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
** All other code has file scope.
**
-** $Id: func.c,v 1.183 2008/01/21 16:22:46 drh Exp $
+** $Id: func.c,v 1.184 2008/02/19 18:29:07 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1146,6 +1146,7 @@ static void test_auxdata(
for(i=0; i<nArg; i++){
char const *z = (char*)sqlite3_value_text(argv[i]);
if( z ){
+ int n;
char *zAux = sqlite3_get_auxdata(pCtx, i);
if( zAux ){
zRet[i*2] = '1';
@@ -1153,10 +1154,10 @@ static void test_auxdata(
}else {
zRet[i*2] = '0';
}
-
- zAux = contextMalloc(pCtx, strlen(z)+1);
+ n = strlen(z) + 1;
+ zAux = contextMalloc(pCtx, n);
if( zAux ){
- strcpy(zAux, z);
+ memcpy(zAux, z, n);
sqlite3_set_auxdata(pCtx, i, zAux, free_test_auxdata);
}
zRet[i*2+1] = ' ';