From 3272b62201c64fdbe577149219d85cdf43a22300 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 4 Nov 2015 22:52:32 +0100 Subject: [PATCH] Don't use NULL for integer arguments This fixes compiler warnings: api/baseapi.cpp:1422:49: warning: passing NULL to non-pointer argument 6 of 'int MultiByteToWideChar(UINT, DWORD, LPCCH, int, LPWSTR, int)' [-Wconversion-null] api/baseapi.cpp:1427:54: warning: passing NULL to non-pointer argument 6 of 'int WideCharToMultiByte(UINT, DWORD, LPCWCH, int, LPSTR, int, LPCCH, LPBOOL)' [-Wconversion-null] Signed-off-by: Stefan Weil --- api/baseapi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/baseapi.cpp b/api/baseapi.cpp index 23e32311ef..e96a564084 100644 --- a/api/baseapi.cpp +++ b/api/baseapi.cpp @@ -1419,12 +1419,12 @@ char* TessBaseAPI::GetHOCRText(int page_number) { #ifdef _WIN32 // convert input name from ANSI encoding to utf-8 int str16_len = MultiByteToWideChar(CP_ACP, 0, input_file_->string(), -1, - NULL, NULL); + NULL, 0); wchar_t *uni16_str = new WCHAR[str16_len]; str16_len = MultiByteToWideChar(CP_ACP, 0, input_file_->string(), -1, uni16_str, str16_len); int utf8_len = WideCharToMultiByte(CP_UTF8, 0, uni16_str, str16_len, NULL, - NULL, NULL, NULL); + 0, NULL, NULL); char *utf8_str = new char[utf8_len]; WideCharToMultiByte(CP_UTF8, 0, uni16_str, str16_len, utf8_str, utf8_len, NULL, NULL);