From 3e88f3de4c34b5ab29c7760f80c8c9014a8474c9 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Mon, 22 Sep 2014 16:53:35 +0200 Subject: [PATCH] Remove the (R) character from the Windows version string. --- pandora_agents/win32/windows/pandora_wmi.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pandora_agents/win32/windows/pandora_wmi.cc b/pandora_agents/win32/windows/pandora_wmi.cc index adfb77cc02..c541d44745 100644 --- a/pandora_agents/win32/windows/pandora_wmi.cc +++ b/pandora_agents/win32/windows/pandora_wmi.cc @@ -372,8 +372,16 @@ Pandora_Wmi::getOSName () { dhGetValue (L"%s", &name, quickfix, L".Caption"); - ret = name; - dhFreeString (name); + if (name != NULL) { + // Remove the (R) character. + for (int i = 0; i < strlen(name); i++) { + if ((unsigned char)name[i] == 0xAE) { + name[i] = ' '; + } + } + ret = name; + dhFreeString (name); + } } NEXT_THROW (quickfix); } catch (string errstr) { @@ -406,6 +414,12 @@ Pandora_Wmi::getOSVersion () { L".CSDVersion"); if (version != NULL) { + // Remove the (R) character. + for (int i = 0; i < strlen(version); i++) { + if ((unsigned char)version[i] == 0xAE) { + version[i] = ' '; + } + } ret = version; dhFreeString (version); }