libbitcoinconsensus: don't require any global constructors

These static objects are only used in once place, so declare them there instead.
This commit is contained in:
Cory Fields
2014-11-24 14:49:43 -05:00
parent a574189e2a
commit 322317951f
2 changed files with 13 additions and 12 deletions

View File

@@ -14,13 +14,13 @@
using namespace std;
/**
* safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything
* even possibly remotely dangerous like & or >
*/
static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@()");
string SanitizeString(const string& str)
{
/**
* safeChars chosen to allow simple messages/URLs/email addresses, but avoid anything
* even possibly remotely dangerous like & or >
*/
static string safeChars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890 .,;_/:?@()");
string strResult;
for (std::string::size_type i = 0; i < str.size(); i++)
{