Skip to content

Commit 3272b62

Browse files
committed
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>
1 parent edf765b commit 3272b62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/baseapi.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1419,12 +1419,12 @@ char* TessBaseAPI::GetHOCRText(int page_number) {
14191419
#ifdef _WIN32
14201420
// convert input name from ANSI encoding to utf-8
14211421
int str16_len = MultiByteToWideChar(CP_ACP, 0, input_file_->string(), -1,
1422-
NULL, NULL);
1422+
NULL, 0);
14231423
wchar_t *uni16_str = new WCHAR[str16_len];
14241424
str16_len = MultiByteToWideChar(CP_ACP, 0, input_file_->string(), -1,
14251425
uni16_str, str16_len);
14261426
int utf8_len = WideCharToMultiByte(CP_UTF8, 0, uni16_str, str16_len, NULL,
1427-
NULL, NULL, NULL);
1427+
0, NULL, NULL);
14281428
char *utf8_str = new char[utf8_len];
14291429
WideCharToMultiByte(CP_UTF8, 0, uni16_str, str16_len, utf8_str,
14301430
utf8_len, NULL, NULL);

0 commit comments

Comments
 (0)