Skip to content

Commit

Permalink
取得可能サイズの指定を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
sanomari committed Oct 26, 2020
1 parent 6d9cb04 commit 6401489
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sakura_core/apiwrap/StdControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace ApiWrap{

// GetWindowText() はコピーした文字数を返す。
// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowtextw
const int actualCopied = ::GetWindowText( hWnd, strText.data(), cchRequired );
const int actualCopied = ::GetWindowText( hWnd, strText.data(), (int)strText.capacity() );
if( actualCopied < 0 ){
// 仕様上は負の場合はありえないが、念の為エラーチェックしておく。
return false;
Expand Down

0 comments on commit 6401489

Please sign in to comment.