From: José Fonseca Date: Thu, 28 Jan 2010 11:52:39 +0000 (+0000) Subject: Handle NULL strings. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=e5d0f94148547cb84e2572d2ef5fed4defb924b4;p=apitrace Handle NULL strings. --- diff --git a/log.cpp b/log.cpp index ca526dd..73bc408 100644 --- a/log.cpp +++ b/log.cpp @@ -325,6 +325,10 @@ void EndReference(void) { void DumpString(const char *str) { const unsigned char *p = (const unsigned char *)str; + if (!str) { + Log::Text("L\""); + return; + } Log::Text("\""); unsigned char c; while((c = *p++) != 0) { @@ -357,6 +361,10 @@ void DumpString(const char *str) { void DumpWString(const wchar_t *str) { const wchar_t *p = str; + if (!str) { + Log::Text("L\""); + return; + } Log::Text("L\""); wchar_t c; while((c = *p++) != 0) {