Extended ASCII Is A Myth Perpetuated By ASCII Table Manufacturers
This commit is contained in:
parent
654c719187
commit
bf58129164
@ -1,5 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
**2.2.9**
|
||||||
|
* Fix String Sanitization
|
||||||
|
|
||||||
**2.2.8**
|
**2.2.8**
|
||||||
* Add "Hide Chat Messages" Optional Feature Flag
|
* Add "Hide Chat Messages" Optional Feature Flag
|
||||||
* Add "Remove Creative Mode Restrictions" Optional Feature Flag
|
* Add "Remove Creative Mode Restrictions" Optional Feature Flag
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
// Sanitize String
|
// Sanitize String
|
||||||
#define MINIMUM_SAFE_CHARACTER 32
|
#define MINIMUM_SAFE_CHARACTER 32
|
||||||
#define MAXIMUM_SAFE_CHARACTER 126
|
#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) {
|
static inline void sanitize_string(char **str, int max_length, unsigned int allow_newlines) {
|
||||||
// Store Message Length
|
// Store Message Length
|
||||||
int length = strlen(*str);
|
int length = strlen(*str);
|
||||||
@ -44,7 +43,7 @@ static inline void sanitize_string(char **str, int max_length, unsigned int allo
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
unsigned char c = (unsigned char) (*str)[i];
|
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
|
// Replace Illegal Character
|
||||||
(*str)[i] = '?';
|
(*str)[i] = '?';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user