diff options
author | Davide Beatrici <davidebeatrici@gmail.com> | 2019-10-12 09:26:05 +0300 |
---|---|---|
committer | Davide Beatrici <davidebeatrici@gmail.com> | 2019-10-12 10:01:28 +0300 |
commit | 243ece36594efa55cb45df38084cd7a0cdbf93c1 (patch) | |
tree | dbdbeb216a517fbc75887ce2add16697e54c06ae /plugins/bf1 | |
parent | 7779447ee4df80c80219d19e8e63c080e9319fb7 (diff) |
plugins/bf1: fix sizeof() bug
Found thanks to GCC's warning:
../mumble_plugin_utils.h: In function ‘int fetch(float*, float*, float*, float*, float*, float*, std::string&, std::wstring&)’:
../mumble_plugin_utils.h:35:16: warning: array subscript 99 is outside array bounds of ‘char [4]’ [-Warray-bounds]
35 | str[size - 1] = 0;
| ~~~~~~~~~~~~~~^~~
bf1.cpp:15:25: note: while referencing ‘team’
15 | char server_name[100], team[4];
| ^~~~
Diffstat (limited to 'plugins/bf1')
-rw-r--r-- | plugins/bf1/bf1.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/bf1/bf1.cpp b/plugins/bf1/bf1.cpp index c2042f2d3..47644a293 100644 --- a/plugins/bf1/bf1.cpp +++ b/plugins/bf1/bf1.cpp @@ -107,7 +107,7 @@ static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, floa oidentity << "{"; // Team - escape(team, sizeof(server_name)); + escape(team, sizeof(team)); if (strcmp(team, "") != 0) { oidentity << std::endl << "\"Team\": \"" << team << "\","; // Set team name in identity. } |