From 844968c4957a257dc9b5b53721f37e88a3e85cac Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 17 May 2002 04:17:48 +0000 Subject: [PATCH] Added check for numeric ids and null pointers (thanks to Dimitrie). --- library/debug.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/library/debug.c b/library/debug.c index d8fae8d8ce7..6f183db50af 100644 --- a/library/debug.c +++ b/library/debug.c @@ -187,6 +187,13 @@ static const char *default_dbgstr_an( const char *str, int n ) { char *dst, *res; + if (!HIWORD(str)) + { + if (!str) return "(null)"; + res = get_tmp_space( 6 ); + sprintf( res, "#%04x", LOWORD(str) ); + return res; + } if (n == -1) n = strlen(str); if (n < 0) n = 0; else if (n > 200) n = 200; @@ -231,6 +238,13 @@ static const char *default_dbgstr_wn( const WCHAR *str, int n ) { char *dst, *res; + if (!HIWORD(str)) + { + if (!str) return "(null)"; + res = get_tmp_space( 6 ); + sprintf( res, "#%04x", LOWORD(str) ); + return res; + } if (n == -1) n = strlenW(str); if (n < 0) n = 0; else if (n > 200) n = 200; -- 2.11.4.GIT