fixed indentations

This commit is contained in:
Hadis Kakanejadi Fard 2017-01-26 15:05:30 -08:00 committed by GitHub
parent 33f5fce36e
commit f42824d390

View file

@ -141,27 +141,23 @@ size_t sqlsrv_stream_read( php_stream* stream, _Out_writes_bytes_(count) char* b
} }
// if the encoding is UTF-8 // if the encoding is UTF-8
if (c_type == SQL_C_WCHAR) { if( c_type == SQL_C_WCHAR ) {
count *= 2;
count *= 2; // undo the shift to use the full buffer // undo the shift to use the full buffer
// flags set to 0 by default, which means that any invalid characters are dropped rather than causing
// flags set to 0 by default, which means that any invalid characters are dropped rather than causing // an error. This happens only on XP.
// an error. This happens only on XP. // convert to UTF-8
// convert to UTF-8
#ifndef __linux__ #ifndef __linux__
DWORD flags = 0; DWORD flags = 0;
if( g_osversion.dwMajorVersion >= SQLSRV_OS_VISTA_OR_LATER ) {
if (g_osversion.dwMajorVersion >= SQLSRV_OS_VISTA_OR_LATER) { // Vista (and later) will detect invalid UTF-16 characters and raise an error.
// Vista (and later) will detect invalid UTF-16 characters and raise an error. flags = WC_ERR_INVALID_CHARS;
flags = WC_ERR_INVALID_CHARS; }
}
#endif #endif
if ( count > INT_MAX || (read >> 1) > INT_MAX ) if( count > INT_MAX || (read >> 1) > INT_MAX ) {
{ LOG(SEV_ERROR, "UTF-16 (wide character) string mapping: buffer length exceeded.");
LOG(SEV_ERROR, "UTF-16 (wide character) string mapping: buffer length exceeded."); throw core::CoreException();
throw core::CoreException(); }
}
#ifdef __linux__ #ifdef __linux__
int enc_len = SystemLocale::FromUtf16( ss->encoding, reinterpret_cast<LPCWSTR>( temp_buf.get() ), int enc_len = SystemLocale::FromUtf16( ss->encoding, reinterpret_cast<LPCWSTR>( temp_buf.get() ),