Extended ASCII Is A Myth Perpetuated By ASCII Table Manufacturers
minecraft-pi-reborn/pipeline/head This commit looks good Details

This commit is contained in:
TheBrokenRail 2021-12-19 17:17:02 -05:00
parent 654c719187
commit bf58129164
3 changed files with 5 additions and 3 deletions

View File

@ -1 +1 @@
2.2.8
2.2.9

View File

@ -1,5 +1,8 @@
# Changelog
**2.2.9**
* Fix String Sanitization
**2.2.8**
* Add "Hide Chat Messages" Optional Feature Flag
* Add "Remove Creative Mode Restrictions" Optional Feature Flag

View File

@ -29,7 +29,6 @@
// Sanitize String
#define MINIMUM_SAFE_CHARACTER 32
#define MAXIMUM_SAFE_CHARACTER 126
#define MINIMUM_EXTENDED_SAFE_CHARACTER 128
static inline void sanitize_string(char **str, int max_length, unsigned int allow_newlines) {
// Store Message Length
int length = strlen(*str);
@ -44,7 +43,7 @@ static inline void sanitize_string(char **str, int max_length, unsigned int allo
continue;
}
unsigned char c = (unsigned char) (*str)[i];
if ((c < MINIMUM_SAFE_CHARACTER || c > MAXIMUM_SAFE_CHARACTER) && c < MINIMUM_EXTENDED_SAFE_CHARACTER) {
if (c < MINIMUM_SAFE_CHARACTER || c > MAXIMUM_SAFE_CHARACTER) {
// Replace Illegal Character
(*str)[i] = '?';
}