Skip to content

Fix some buffer sizes in shipped plugins#343

Merged
psychonic merged 2 commits intomasterfrom
fix-sizes
Jun 4, 2015
Merged

Fix some buffer sizes in shipped plugins#343
psychonic merged 2 commits intomasterfrom
fix-sizes

Conversation

@psychonic
Copy link
Member

See notes on commits.

psychonic added 2 commits June 3, 2015 22:28
As more games are now supporting maps nested in subfolders or in folders outside of the maps folder,
we need to account for the full path that the game uses to refer to the map for compatibility. Many other
places for fixed for this already after CS:GO added Steam Workshop support for maps.
Found any I could not using MAX_NAME_LENGTH and changed them to use it. I think that we should
increase MAX_NAME_LENGTH to 128 for CS:GO at some point as that's what it uses internally.
(Presumably to get the client's full multibyte name from Steam without truncation mid-codepoint which
can happen in other games. Steam's max is 32 characters if I remember correctly, but allows multibyte chars).
@asherkin
Copy link
Member

asherkin commented Jun 4, 2015

🚢

psychonic added a commit that referenced this pull request Jun 4, 2015
Fix some buffer sizes in shipped plugins.
@psychonic psychonic merged commit 850a73d into master Jun 4, 2015
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be +1?

@psychonic
Copy link
Member Author

No, one of the MAX_NAME_LENGTH is a null, leaving MAX_NAME_LENGTH -1. each of those can take up to 2 chars after adding escape chars. So, ((MAX_NAME_LENGTH - 1) * 2 ) == (MAX_NAME_LENGTH - 2), plus one for a null, equals what is in the inc.

@psychonic psychonic deleted the fix-sizes branch September 13, 2015 14:45
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.

3 participants