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 (c_type == SQL_C_WCHAR) {
count *= 2; // 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
// an error. This happens only on XP.
// convert to UTF-8
if( c_type == SQL_C_WCHAR ) {
count *= 2;
// 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
// an error. This happens only on XP.
// convert to UTF-8
#ifndef __linux__
DWORD flags = 0;
if (g_osversion.dwMajorVersion >= SQLSRV_OS_VISTA_OR_LATER) {
// Vista (and later) will detect invalid UTF-16 characters and raise an error.
flags = WC_ERR_INVALID_CHARS;
}
DWORD flags = 0;
if( g_osversion.dwMajorVersion >= SQLSRV_OS_VISTA_OR_LATER ) {
// Vista (and later) will detect invalid UTF-16 characters and raise an error.
flags = WC_ERR_INVALID_CHARS;
}
#endif
if ( count > INT_MAX || (read >> 1) > INT_MAX )
{
LOG(SEV_ERROR, "UTF-16 (wide character) string mapping: buffer length exceeded.");
throw core::CoreException();
}
if( count > INT_MAX || (read >> 1) > INT_MAX ) {
LOG(SEV_ERROR, "UTF-16 (wide character) string mapping: buffer length exceeded.");
throw core::CoreException();
}
#ifdef __linux__
int enc_len = SystemLocale::FromUtf16( ss->encoding, reinterpret_cast<LPCWSTR>( temp_buf.get() ),