aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/printf.c2
-rw-r--r--src/utf.c3
-rw-r--r--src/vdbeInt.h2
-rw-r--r--src/vdbeaux.c1
4 files changed, 5 insertions, 3 deletions
diff --git a/src/printf.c b/src/printf.c
index cb03b3dc1..40af67e37 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -800,7 +800,7 @@ char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
return z;
}
-#if defined(SQLITE_TEST)
+#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
/*
** A version of printf() that understands %lld. Used for debugging.
** The printf() built into some versions of windows does not understand %lld
diff --git a/src/utf.c b/src/utf.c
index 3c1042502..16454c2ff 100644
--- a/src/utf.c
+++ b/src/utf.c
@@ -12,7 +12,7 @@
** This file contains routines used to translate between UTF-8,
** UTF-16, UTF-16BE, and UTF-16LE.
**
-** $Id: utf.c,v 1.22 2004/06/18 17:10:17 drh Exp $
+** $Id: utf.c,v 1.23 2004/06/22 22:04:46 drh Exp $
**
** Notes on UTF-8:
**
@@ -321,6 +321,7 @@ int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
WRITE_UTF8(z, 0);
pMem->n = (z-zOut)-1;
}
+ assert( pMem->n+1<=len );
}
sqlite3VdbeMemRelease(pMem);
diff --git a/src/vdbeInt.h b/src/vdbeInt.h
index 688380dd0..946f9f716 100644
--- a/src/vdbeInt.h
+++ b/src/vdbeInt.h
@@ -121,8 +121,8 @@ struct Mem {
u8 enc; /* TEXT_Utf8, TEXT_Utf16le, or TEXT_Utf16be */
double r; /* Real value */
char *z; /* String or BLOB value */
- char zShort[NBFS]; /* Space for short strings */
void (*xDel)(void *); /* If not null, call this function to delete Mem.z */
+ char zShort[NBFS]; /* Space for short strings */
};
typedef struct Mem Mem;
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index 249d32c8b..8efdac6f3 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -1602,6 +1602,7 @@ int sqlite3VdbeSerialGet(
assert( serial_type>=12 );
pMem->z = (char *)buf;
pMem->n = len;
+ pMem->xDel = 0;
if( serial_type&0x01 ){
pMem->flags = MEM_Str | MEM_Ephem;
}else{