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

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavide Beatrici <davidebeatrici@users.noreply.github.com>2016-05-27 20:40:25 +0300
committerMikkel Krautz <mikkel@krautz.dk>2016-05-29 01:57:57 +0300
commit7591b5c153d3ca59c7cb97f71bb6c046d4489ae4 (patch)
treef7e117b8ac7f7877baace7dbaa56361382c3c36c /plugins/bf4
parentdecab3ffcb69cfc33ccaa8621eb0816505eba4f2 (diff)
Move "escape" function to mumble_plugin_utils.h header
Diffstat (limited to 'plugins/bf4')
-rw-r--r--plugins/bf4/bf4.cpp40
1 files changed, 2 insertions, 38 deletions
diff --git a/plugins/bf4/bf4.cpp b/plugins/bf4/bf4.cpp
index eafbc9d96..3e39069b2 100644
--- a/plugins/bf4/bf4.cpp
+++ b/plugins/bf4/bf4.cpp
@@ -3,44 +3,8 @@
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
-#include "../mumble_plugin_win32.h"
-#include <algorithm>
-
-// escape lossily converts the given
-// string to ASCII, replacing any
-// character not within the printable
-// ASCII region (32-126) with an ASCII
-// space character.
-//
-// escape also replaces any double quote
-// characters with an ASCII space. This
-// allows the string to be safely used
-// when constructing JSON documents via
-// string concatenation.
-static void escape(char *str) {
- char *c = str;
-
- while (*c != '\0') {
- // For JSON compatibility, the string
- // can't contain double quotes.
- // If a double quote is found, replace
- // it with an ASCII space.
- if (*c == '"') {
- *c = ' ';
- }
-
- // Ensure the string is within printable
- // ASCII. If not, replace the offending
- // byte with an ASCII space.
- if (*c < 32) {
- *c = ' ';
- } else if (*c > 126) {
- *c = ' ';
- }
-
- c += 1;
- }
-}
+#include "../mumble_plugin_win32.h" // Include standard plugin header.
+#include "../mumble_plugin_utils.h" // Include plugin header for special functions, like "escape".
static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front, float *camera_top, std::string &context, std::wstring &identity) {
for (int i=0;i<3;i++) {