diff options
author | drh <drh@noemail.net> | 2020-01-06 19:23:41 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2020-01-06 19:23:41 +0000 |
commit | 5ca06329c9c8d231ffe59eb1b2bd76056fc252b8 (patch) | |
tree | 8ca175249a65b35dd90cf681a4fd0118e4f6228b /src/utf.c | |
parent | 2e26a602a3417bcc8ea65a434b7f56f608127dd2 (diff) | |
download | sqlite-5ca06329c9c8d231ffe59eb1b2bd76056fc252b8.tar.gz sqlite-5ca06329c9c8d231ffe59eb1b2bd76056fc252b8.zip |
Rewrite the (debugging use only) sqlite3VdbeMemPrettyPrint() function to use
the safer StrAccum interface rather than writing directly into a static string
buffer. Perhaps this will address ticket [bbd55a97e66ff50d], which we are
unable to reproduce.
FossilOrigin-Name: 69f6a7e42f42116d29514239575ee1dc381b5b673da012cb5f3e8cf17922d493
Diffstat (limited to 'src/utf.c')
-rw-r--r-- | src/utf.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -215,9 +215,11 @@ SQLITE_NOINLINE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){ #if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG) { - char zBuf[100]; - sqlite3VdbeMemPrettyPrint(pMem, zBuf); - fprintf(stderr, "INPUT: %s\n", zBuf); + StrAccum acc; + char zBuf[1000]; + sqlite3StrAccumInit(&acc, 0, zBuf, sizeof(zBuf), 0); + sqlite3VdbeMemPrettyPrint(pMem, &acc); + fprintf(stderr, "INPUT: %s\n", sqlite3StrAccumFinish(&acc)); } #endif @@ -325,9 +327,11 @@ SQLITE_NOINLINE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){ translate_out: #if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG) { - char zBuf[100]; - sqlite3VdbeMemPrettyPrint(pMem, zBuf); - fprintf(stderr, "OUTPUT: %s\n", zBuf); + StrAccum acc; + char zBuf[1000]; + sqlite3StrAccumInit(&acc, 0, zBuf, sizeof(zBuf), 0); + sqlite3VdbeMemPrettyPrint(pMem, &acc); + fprintf(stderr, "OUTPUT: %s\n", sqlite3StrAccumFinish(&acc)); } #endif return SQLITE_OK; |