From e65b19f7c8b92bf87f893036c289ea9418a3f6c9 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Tue, 28 Dec 2010 09:56:15 -0500
Subject: [PATCH] KWSys: Avoid passing string literal as char*

Pass the lpClass argument of RegCreateKeyEx as a real char[] instead of
a string literal.  At least one platform declares the argument as char*
instead of "const char*".
---
 Registry.cxx         | 3 ++-
 SystemTools.cxx      | 3 ++-
 kwsysDateStamp.cmake | 2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Registry.cxx b/Registry.cxx
index 284e8ad..cd521c9 100644
--- a/Registry.cxx
+++ b/Registry.cxx
@@ -401,8 +401,9 @@ bool RegistryHelper::Open(const char *toplevel, const char *subkey,
       }
     else
       {
+      char lpClass[] = "";
       res = ( RegCreateKeyEx(scope, str.str().c_str(),
-          0, "", REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE,
+          0, lpClass, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE,
           NULL, &this->HKey, &dwDummy) == ERROR_SUCCESS );
       }
     if ( res != 0 )
diff --git a/SystemTools.cxx b/SystemTools.cxx
index 60d6869..cef2de6 100644
--- a/SystemTools.cxx
+++ b/SystemTools.cxx
@@ -734,10 +734,11 @@ bool SystemTools::WriteRegistryValue(const char *key, const char *value,
   
   HKEY hKey;
   DWORD dwDummy;
+  char lpClass[] = "";
   if(RegCreateKeyEx(primaryKey, 
                     second.c_str(), 
                     0, 
-                    "",
+                    lpClass,
                     REG_OPTION_NON_VOLATILE,
                     SystemToolsMakeRegistryMode(KEY_WRITE, view),
                     NULL,
diff --git a/kwsysDateStamp.cmake b/kwsysDateStamp.cmake
index 433a86f..0416938 100644
--- a/kwsysDateStamp.cmake
+++ b/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR  2010)
 SET(KWSYS_DATE_STAMP_MONTH 12)
 
 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   21)
+SET(KWSYS_DATE_STAMP_DAY   28)
-- 
GitLab