Skip to content

Commit 71a4d25

Browse files
committed
fix for empty message boxes
1 parent 9532dea commit 71a4d25

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

cppcryptfs/cppcryptfs.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,13 @@ BOOL CcppcryptfsApp::InitInstance()
158158
} else {
159159
if (result.length() >= CMD_PIPE_RESPONSE_LENGTH) {
160160
if (wcsncmp(result.c_str(), CMD_PIPE_SUCCESS_STR, CMD_PIPE_RESPONSE_LENGTH) == 0) {
161-
if (have_console)
162-
wcout << wstring(result.c_str() + CMD_PIPE_RESPONSE_LENGTH);
163-
else
164-
::MessageBox(NULL, result.c_str() + CMD_PIPE_RESPONSE_LENGTH, L"cppcryptfs", MB_OK);
161+
wstring mes = result.c_str() + CMD_PIPE_RESPONSE_LENGTH;
162+
if (mes.length() > 0) {
163+
if (have_console)
164+
wcout << mes << endl;
165+
else
166+
::MessageBox(NULL, mes.c_str(), L"cppcryptfs", MB_OK);
167+
}
165168
} else {
166169
err_mes = wstring(result.c_str() + CMD_PIPE_RESPONSE_LENGTH);
167170
}

0 commit comments

Comments
 (0)