1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

Fix bugs introduced by checkin (2656) and do some modest code enhancements. (CVS 2657)

FossilOrigin-Name: 7b56763a8b514834198d2392639d6d726b17d901
This commit is contained in:
drh
2005-09-05 20:06:49 +00:00
parent c092998715
commit d81bd4e209
6 changed files with 22 additions and 21 deletions

View File

@@ -88,7 +88,7 @@ static WCHAR *utf8ToUnicode(const char *zFilename){
return 0;
}
nByte = MultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0)*sizeof(WCHAR);
zWideFilename = sqliteMalloc( nByte );
zWideFilename = sqliteMalloc( nByte*sizeof(zWideFilename[0]) );
if( zWideFilename==0 ){
return 0;
}
@@ -387,7 +387,7 @@ int sqlite3OsTempFileName(char *zBuf){
GetTempPathW(SQLITE_TEMPNAME_SIZE-30, zWidePath);
zMulti = unicodeToUtf8(zWidePath);
if( zMulti ){
memcpy(zTempPath, zMulti, SQLITE_TEMPNAME_SIZE-30);
strncpy(zTempPath, zMulti, SQLITE_TEMPNAME_SIZE-30);
zTempPath[SQLITE_TEMPNAME_SIZE-30] = 0;
sqliteFree(zMulti);
}