mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-25 11:39:06 +08:00
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 <sw@weilnetz.de>
This commit is contained in:
parent
edf765b952
commit
3272b62201
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user