Win: Prevent crash in qt_message_fatal()

The source argument can be nullptr, e.g. if debug information
has been stripped out.

Task-number: QTBUG-51195
Change-Id: Ie229c82278c420200cad33c19e8c3f52ab7f12c3
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Kai Koehne 2016-02-18 13:20:24 +01:00
parent 4905bf0654
commit c320d5221f

View File

@ -250,10 +250,11 @@ static inline void convert_to_wchar_t_elided(wchar_t *d, size_t space, const cha
if (len + 1 > space) {
const size_t skip = len - space + 4; // 4 for "..." + '\0'
s += skip;
len -= skip;
for (int i = 0; i < 3; ++i)
*d++ = L'.';
}
while (*s)
while (len--)
*d++ = *s++;
*d++ = 0;
}