Skip to content

Fix setAmxString cutting off the last character of strings#384

Closed
metita wants to merge 1 commit into
rehlds:masterfrom
metita:fix-setamxstring-truncation
Closed

Fix setAmxString cutting off the last character of strings#384
metita wants to merge 1 commit into
rehlds:masterfrom
metita:fix-setamxstring-truncation

Conversation

@metita

@metita metita commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #383

Since 3c08fde setAmxString treats max as the full buffer size including the null terminator, but plugins pass charsmax(buffer) which already excludes it. So every native that returns a string (get_entvar, get_member, etc.) was losing the last character.

This restores the old behavior (copy up to max chars, terminator goes at dest[max]) and keeps the null pointer check.

@metita

metita commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

closing in favor of #385, same fix

@metita metita closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Wrong var lenghts

1 participant