Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/drtimcooper/XmlRpc4Win.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2017-08-21 21:10:59 +0300
committerKacper Michajłow <kasper93@gmail.com>2017-08-21 21:11:02 +0300
commit9eea9412a2a8effc1bccffb22212d04747ef75ae (patch)
tree58fc780f5459ab04bea3a7385dcd5f3b5214579a
parent1d7362ccd55d5910a212d06afe377d82dc664d05 (diff)
Change Callback declaration to use const string for status.
It is bad to pass string literals as non-const string pointer, because someone might try to edit it.
-rw-r--r--TimXmlRpc.cpp4
-rw-r--r--timxmlrpc.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/TimXmlRpc.cpp b/TimXmlRpc.cpp
index 13e0ec2..7b9535d 100644
--- a/TimXmlRpc.cpp
+++ b/TimXmlRpc.cpp
@@ -135,7 +135,7 @@ XmlRpcValue::ValueArray::~ValueArray()
//---------------------------------- base64.h: -------------------------------
/* <Chris Morley> */
-static
+static const
int _base64Chars[]= {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
'0','1','2','3','4','5','6','7','8','9',
@@ -1449,7 +1449,7 @@ static void CALLBACK myInternetCallback(HINTERNET,
XmlRpcImplementation *connection = (XmlRpcImplementation*)dwContext;
if (connection && connection->Callback) {
static char buf[512];
- char* status;
+ const char* status;
switch (dwInternetStatus) {
case INTERNET_STATUS_RECEIVING_RESPONSE: if (connection->totalBytes == 0)
status = "Waiting for response";
diff --git a/timxmlrpc.h b/timxmlrpc.h
index eac3f54..87b9a9e 100644
--- a/timxmlrpc.h
+++ b/timxmlrpc.h
@@ -53,7 +53,7 @@ See 'SampleMain.cpp' for a more elaborate example.
-typedef void (*XmlRpcCallback)(void* context, char* status);
+typedef void (*XmlRpcCallback)(void* context, const char* status);
/* A 'get username and password' function is used for HTTP basic authentication.