From bf58129164f7acf53221a5cad1af16946aed0b3d Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sun, 19 Dec 2021 17:17:02 -0500 Subject: [PATCH] Extended ASCII Is A Myth Perpetuated By ASCII Table Manufacturers --- VERSION | 2 +- docs/CHANGELOG.md | 3 +++ libreborn/include/libreborn/string.h | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 23a63f524..a6333e400 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.8 +2.2.9 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index a48fac6d1..4b33873db 100644 --- a/docs/CHANGELOG.md +++ b/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 diff --git a/libreborn/include/libreborn/string.h b/libreborn/include/libreborn/string.h index 755b30202..d04573b37 100644 --- a/libreborn/include/libreborn/string.h +++ b/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] = '?'; }