]> code.citadel.org Git - citadel.git/blobdiff - webcit-ng/server/util.c
moved whitespace around
[citadel.git] / webcit-ng / server / util.c
index e14dcd2e4e802df834b6996dda6f0ed3cf587fde..6ab4ef04c5a7e59a8525b79d67bd1aa6b626bd66 100644 (file)
@@ -1,6 +1,6 @@
 // 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"
 
@@ -21,10 +21,11 @@ int unescape_input(char *buf) {
 
        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;
@@ -37,9 +38,9 @@ int unescape_input(char *buf) {
                                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;
                        }
                }