Fix for nbsp in messages

This commit is contained in:
Andrew Pamment 2018-10-23 11:44:39 +10:00
parent 0d26b5b06c
commit 8583ab6737
2 changed files with 2 additions and 2 deletions

View File

@ -91,7 +91,7 @@ int www_send_email(struct user_record *user, char *recipient, char *subject, cha
uname(&name);
for (char *p = ibody; *p != '\0'; ++p) {
if (*p == 0xc2 && *(p+1) == 0xa0) {
if ((*p & 0xff) == 0xc2 && (*(p + 1) & 0xff) == 0xa0) {
stralloc_append1(&sa, ' ');
p++;
} else if (*p != '\n') {

View File

@ -1119,7 +1119,7 @@ int www_send_msg(struct user_record *user, char *to, char *subj, int conference,
// remove nbsp
while (*p != '\0') {
if (*p == 0xc2 && *(p + 1) == 0xa0) {
if ((*p & 0xff) == 0xc2 && (*(p + 1) & 0xff) == 0xa0) {
stralloc_append1(&unhtmlized, ' ');
p++;
} else {