From e5d0f94148547cb84e2572d2ef5fed4defb924b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 28 Jan 2010 11:52:39 +0000 Subject: [PATCH] Handle NULL strings. --- log.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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) { -- 2.45.2