From: danielk1977 Date: Mon, 23 Feb 2009 14:42:53 +0000 (+0000) Subject: Ensure the return value of sqlite3_errmsg16() is aligned on a 2-byte boundary. Ticket... X-Git-Tag: version-3.6.15~437 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c5c3cab89cd7c755b173a8aa7cffc9bcfbbbb87;p=thirdparty%2Fsqlite.git Ensure the return value of sqlite3_errmsg16() is aligned on a 2-byte boundary. Ticket #3665. (CVS 6313) FossilOrigin-Name: 9b8acf8319ec760713773407a4d5a33dea8d75e8 --- diff --git a/manifest b/manifest index 8949162390..0af59bc7d2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C The\ssqlite3.def\sfile\sis\sautomatically\sgenerated\sand\sis\snot\ssuppose\sto\sbe\npart\sof\sthe\ssource\scode\srepository.\s\sSo\sit\sis\shereby\sremoved.\nTicket\s#3671.\s(CVS\s6312) -D 2009-02-21T22:38:59 +C Ensure\sthe\sreturn\svalue\sof\ssqlite3_errmsg16()\sis\saligned\son\sa\s2-byte\sboundary.\sTicket\s#3665.\s(CVS\s6313) +D 2009-02-23T14:42:53 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in d64baddbf55cdf33ff030e14da837324711a4ef7 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -122,7 +122,7 @@ F src/insert.c 529a1b9889fe3c2eb093cc02c3053b04c65daa7e F src/journal.c e00df0c0da8413ab6e1bb7d7cab5665d4a9000d0 F src/legacy.c 8b3b95d48d202614946d7ce7256e7ba898905c3b F src/loadext.c 3f96631089fc4f3871a67f02f2e4fc7ea4d51edc -F src/main.c 4912460dab29e4d37e4ba1d78320c6a77bb95ad8 +F src/main.c f7f7c2fcbda632bfb7995c77636660a019a172c7 F src/malloc.c 072ddad9b7e908e9b9a2a494d4758dadeced61ae F src/mem0.c f2f84062d1f35814d6535c9f9e33de3bfb3b132c F src/mem1.c 3bfb39e4f60b0179713a7c087b2d4f0dc205735f @@ -700,7 +700,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P 94945801973c0e659de3f429c98a7d95a8c693f6 -R 010b383a7514e14bc8dec8e8cec1ad23 -U drh -Z 4f428b9ed3dc2e183bed46afde954bf5 +P 5dcda154090e55a22b4d19f9def42beba8733f50 +R 995f5a3ef19f5c195500de164454e1d4 +U danielk1977 +Z a29e2652178988b1757076cd7ae15c3a diff --git a/manifest.uuid b/manifest.uuid index 2c24d55846..f3e4c746ad 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -5dcda154090e55a22b4d19f9def42beba8733f50 \ No newline at end of file +9b8acf8319ec760713773407a4d5a33dea8d75e8 \ No newline at end of file diff --git a/src/main.c b/src/main.c index 0339379104..9b4578afe7 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.528 2009/02/05 16:31:46 drh Exp $ +** $Id: main.c,v 1.529 2009/02/23 14:42:53 danielk1977 Exp $ */ #include "sqliteInt.h" @@ -1258,31 +1258,24 @@ const char *sqlite3_errmsg(sqlite3 *db){ ** error. */ const void *sqlite3_errmsg16(sqlite3 *db){ - /* Because all the characters in the string are in the unicode - ** range 0x00-0xFF, if we pad the big-endian string with a - ** zero byte, we can obtain the little-endian string with - ** &big_endian[1]. - */ - static const char outOfMemBe[] = { - 0, 'o', 0, 'u', 0, 't', 0, ' ', - 0, 'o', 0, 'f', 0, ' ', - 0, 'm', 0, 'e', 0, 'm', 0, 'o', 0, 'r', 0, 'y', 0, 0, 0 + static const u16 outOfMem[] = { + 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0 }; - static const char misuseBe [] = { - 0, 'l', 0, 'i', 0, 'b', 0, 'r', 0, 'a', 0, 'r', 0, 'y', 0, ' ', - 0, 'r', 0, 'o', 0, 'u', 0, 't', 0, 'i', 0, 'n', 0, 'e', 0, ' ', - 0, 'c', 0, 'a', 0, 'l', 0, 'l', 0, 'e', 0, 'd', 0, ' ', - 0, 'o', 0, 'u', 0, 't', 0, ' ', - 0, 'o', 0, 'f', 0, ' ', - 0, 's', 0, 'e', 0, 'q', 0, 'u', 0, 'e', 0, 'n', 0, 'c', 0, 'e', 0, 0, 0 + static const u16 misuse[] = { + 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ', + 'r', 'o', 'u', 't', 'i', 'n', 'e', ' ', + 'c', 'a', 'l', 'l', 'e', 'd', ' ', + 'o', 'u', 't', ' ', + 'o', 'f', ' ', + 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', 0 }; const void *z; if( !db ){ - return (void *)(&outOfMemBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]); + return (void *)outOfMem; } if( !sqlite3SafetyCheckSickOrOk(db) ){ - return (void *)(&misuseBe[SQLITE_UTF16NATIVE==SQLITE_UTF16LE?1:0]); + return (void *)misuse; } sqlite3_mutex_enter(db->mutex); assert( !db->mallocFailed );