mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-09 14:21:03 +03:00
Fix an overzealous assert() in the UTF-16 to UTF-8 converter. (CVS 3338)
FossilOrigin-Name: 096bd8212fa06c7271fc24280133d1f0864ffb42
This commit is contained in:
@@ -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.39 2006/04/16 12:05:03 drh Exp $
|
||||
** $Id: utf.c,v 1.40 2006/07/26 14:57:30 drh Exp $
|
||||
**
|
||||
** Notes on UTF-8:
|
||||
**
|
||||
@@ -462,8 +462,8 @@ char *sqlite3utf16to8(const void *z, int nByte){
|
||||
memset(&m, 0, sizeof(m));
|
||||
sqlite3VdbeMemSetStr(&m, z, nByte, SQLITE_UTF16NATIVE, SQLITE_STATIC);
|
||||
sqlite3VdbeChangeEncoding(&m, SQLITE_UTF8);
|
||||
assert( m.flags & MEM_Term );
|
||||
assert( m.flags & MEM_Str );
|
||||
assert( (m.flags & MEM_Term)!=0 || sqlite3MallocFailed() );
|
||||
assert( (m.flags & MEM_Str)!=0 || sqlite3MallocFailed() );
|
||||
return (m.flags & MEM_Dyn)!=0 ? m.z : sqliteStrDup(m.z);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user