-//
// Utility functions
-//
-// Copyright (c) 1996-2022 by the citadel.org team
-//
-// This program is open source software. Use, duplication, or
-// disclosure are subject to the GNU General Public License v3.
+// Copyright (c) 1996-2023 by the citadel.org team
+// This program is open source software. Use, duplication, or disclosure is subject to the GNU General Public License v3.
#include "webcit.h"
a = 0;
while (a < buflen) {
- if (buf[a] == '+')
+ if (buf[a] == '+') {
buf[a] = ' ';
+ }
if (buf[a] == '%') {
- // don't let % chars through, rather truncate the input.
+ // don't let % chars through - instead truncate the input.
if (a + 2 > buflen) {
buf[a] = '\0';
buflen = a;
b = decode_hex(hex);
buf[a] = (char) b;
len = buflen - a - 2;
- if (len > 0)
+ if (len > 0) {
memmove(&buf[a + 1], &buf[a + 3], len);
-
+ }
buflen -= 2;
}
}