Browse Source

Extended ASCII Is A Myth Perpetuated By ASCII Table Manufacturers

pull/36/head 2.2.9
TheBrokenRail 9 months ago
parent
commit
bf58129164
  1. 2
      VERSION
  2. 3
      docs/CHANGELOG.md
  3. 3
      libreborn/include/libreborn/string.h

2
VERSION

@ -1 +1 @@
2.2.8
2.2.9

3
docs/CHANGELOG.md

@ -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

3
libreborn/include/libreborn/string.h

@ -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] = '?';
}

Loading…
Cancel
Save