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:
authordavidebeatrici <davidebeatrici@gmail.com>2016-10-23 22:32:08 +0300
committerdavidebeatrici <davidebeatrici@gmail.com>2016-10-23 22:32:08 +0300
commit90bcd40d3920e86598c29d30165f0ab106ae82c2 (patch)
tree0feb6b25e7af90ed485c66f61108b9219529ff53 /plugins/wow
parent0258d2a1e2cbe76fb5349171235679a2a434e63a (diff)
plugins: Move NUL terminator to escape function
Diffstat (limited to 'plugins/wow')
-rw-r--r--plugins/wow/wow.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/wow/wow.cpp b/plugins/wow/wow.cpp
index daba93d36..f906a82bf 100644
--- a/plugins/wow/wow.cpp
+++ b/plugins/wow/wow.cpp
@@ -75,8 +75,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
std::ostringstream ocontext;
// Realm
- realm[sizeof(realm)-1] = 0; // NUL terminate queried C strings. We do this to ensure the strings from the game are NUL terminated. They should be already, but we can't take any chances.
- escape(realm);
+ escape(realm, sizeof(realm));
if (strcmp(realm, "") != 0) { // Set Realm string only if not empty
ocontext << " {\"Realm\": \"" << realm << "\"}"; // Set context with Realm's name
}
@@ -89,8 +88,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa
oidentity << "{";
// Player
- player[sizeof(player)-1] = 0; // NUL terminate queried C strings. We do this to ensure the strings from the game are NUL terminated. They should be already, but we can't take any chances.
- escape(player);
+ escape(player, sizeof(player));
if (strcmp(player, "") != 0) {
oidentity << std::endl;
oidentity << "\"Player\": \"" << player << "\""; // Set player nickname in identity.