Don't bother reading this commit.
authorArt Cancro <ajc@citadel.org>
Wed, 24 Jan 2024 01:22:33 +0000 (15:22 -1000)
committerArt Cancro <ajc@citadel.org>
Wed, 24 Jan 2024 01:22:33 +0000 (15:22 -1000)
webcit-ng/server/html2html.c

index f04ddef7f7eda0acd237b572668990853b5e058d..506a70de7fe1b538b800f5b3b2270fe8ad9a8bf4 100644 (file)
 void stripquotes(char *s) {
        int len;
 
-       if (!s)
+       if (!s) {
                return;
+       }
 
        len = strlen(s);
-       if (len < 2)
+       if (len < 2) {
                return;
+       }
 
        if (((s[0] == '\"') && (s[len - 1] == '\"')) || ((s[0] == '\'') && (s[len - 1] == '\''))) {
                s[len - 1] = 0;
@@ -36,19 +38,24 @@ void extract_charset_from_meta(char *charset, char *meta_http_equiv, char *meta_
        char *ptr;
        char buf[64];
 
-       if (!charset)
+       if (!charset) {
                return;
-       if (!meta_http_equiv)
+       }
+       if (!meta_http_equiv) {
                return;
-       if (!meta_content)
+       }
+       if (!meta_content) {
                return;
+       }
 
-       if (strcasecmp(meta_http_equiv, "Content-type"))
+       if (strcasecmp(meta_http_equiv, "Content-type")) {
                return;
+       }
 
        ptr = strchr(meta_content, ';');
-       if (!ptr)
+       if (!ptr) {
                return;
+       }
 
        safestrncpy(buf, ++ptr, sizeof buf);
        string_trim(buf);
@@ -65,8 +72,9 @@ void extract_charset_from_meta(char *charset, char *meta_http_equiv, char *meta_
                }
 
                // Remove wandering punctuation
-               if ((ptr = strchr(charset, '\"')))
+               if ((ptr = strchr(charset, '\"'))) {
                        *ptr = 0;
+               }
                string_trim(charset);
        }
 }