From 320b16110f0f9cef032a64846dc792d40ccd367b Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 6 Dec 2012 14:59:15 +0100 Subject: [PATCH] QProcess: Fix compilation with MinGW newer mingw-w64 headers do not support swprintf(wchar_t*,wchar_t*, ..) any more. Change-Id: I2fc1fb51ba8d5237149697f77a91abd6469ebb09 Reviewed-by: Thiago Macieira --- src/corelib/io/qprocess_win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index d19ab69..780efda 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -82,7 +82,8 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe) forever { // ### The user must make sure to call qsrand() to make the pipe names less predictable. // ### Replace the call to qrand() with a secure version, once we have it in Qt. - swprintf(pipeName, L"\\\\.\\pipe\\qt-%X", qrand()); + swprintf(pipeName, sizeof(pipeName) / sizeof(pipeName[0]), + L"\\\\.\\pipe\\qt-%X", qrand()); DWORD dwPipeFlags = PIPE_TYPE_BYTE | PIPE_WAIT; if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA) -- 2.7.4