[sr-dev] git:master:4c6715b5: xmlrpc: fixed error assigning to str variable added by previous commit

Daniel-Constantin Mierla miconda at gmail.com
Tue Mar 2 08:21:01 CET 2021


Module: kamailio
Branch: master
Commit: 4c6715b5e4a0938ece2937a787c6d2ed6e81a3d8
URL: https://github.com/kamailio/kamailio/commit/4c6715b5e4a0938ece2937a787c6d2ed6e81a3d8

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-03-02T08:20:12+01:00

xmlrpc: fixed error assigning to str variable added by previous commit

---

Modified: src/modules/xmlrpc/xmlrpc.c

---

Diff:  https://github.com/kamailio/kamailio/commit/4c6715b5e4a0938ece2937a787c6d2ed6e81a3d8.diff
Patch: https://github.com/kamailio/kamailio/commit/4c6715b5e4a0938ece2937a787c6d2ed6e81a3d8.patch

---

diff --git a/src/modules/xmlrpc/xmlrpc.c b/src/modules/xmlrpc/xmlrpc.c
index 5e2a7466b0..266283b963 100644
--- a/src/modules/xmlrpc/xmlrpc.c
+++ b/src/modules/xmlrpc/xmlrpc.c
@@ -264,7 +264,8 @@ static str member_prefix  = STR_STATIC_INIT("<member>");
 static str member_suffix  = STR_STATIC_INIT("</member>");
 static str name_prefix    = STR_STATIC_INIT("<name>");
 static str name_suffix    = STR_STATIC_INIT("</name>");
-static str nil_value     = STR_STATIC_INIT("<nil/>");
+static str empty_value    = STR_STATIC_INIT("");
+static str nil_value      = STR_STATIC_INIT("<nil/>");
 
 /** Garbage collection data structure.
  *
@@ -1073,8 +1074,8 @@ static int print_value(struct xmlrpc_reply* res,
 				suffix = string_suffix;
 				body.len = strlen(body.s);
 			} else {
-				prefix = "";
-				suffix = "";
+				prefix = empty_value;
+				suffix = empty_value;
 				body = nil_value;
 			}
 			break;
@@ -1086,8 +1087,8 @@ static int print_value(struct xmlrpc_reply* res,
 				suffix = string_suffix;
 				body = *sp;
 			} else {
-				prefix = "";
-				suffix = "";
+				prefix = empty_value;
+				suffix = empty_value;
 				body = nil_value;
 			}
 			break;




More information about the sr-dev mailing list