Skip to content

Commit 49303e7

Browse files
committed
Fix .teamname parsing off-by-one in substr offset
'teamname' is 8 chars + 1 space = 9 char prefix, but the code used offset 10 (skipping first char of the name) and required >10 chars (single-letter names were rejected as empty). Fix: offset 9, check >9.
1 parent 586d4f3 commit 49303e7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/plugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ bool Plugin::DispatchPlayerCommand(edict_t *entity, const std::string &command)
15001500
Say(entity, "[XMP] Can only set team name before the match starts.\n");
15011501
return true;
15021502
}
1503-
const std::string name = (normalized.size() > 10) ? normalized.substr(10) : "";
1503+
const std::string name = (normalized.size() > 9) ? normalized.substr(9) : "";
15041504
if (name.empty() || name.length() > 32) {
15051505
Say(entity, "[XMP] Usage: .teamname <name> (max 32 characters).\n");
15061506
return true;

0 commit comments

Comments
 (0)