Replace striplt() with string_trim() in all the places VS Code simply decided not to.
authorArt Cancro <ajc@citadel.org>
Wed, 23 Nov 2022 20:57:03 +0000 (15:57 -0500)
committerArt Cancro <ajc@citadel.org>
Wed, 23 Nov 2022 20:57:03 +0000 (15:57 -0500)
textclient/citadel_ipc.c
webcit/availability.c
webcit/calendar.c
webcit/dav_get.c
webcit/event.c
webcit/html2html.c
webcit/notes.c
webcit/roomops.c
webcit/useredit.c

index a2f583c6e909b77348eaf2af1de18ec8e7e2b880..f4a5695b8ac6bc4950b0ea9b88d08176401aadfe 100644 (file)
@@ -671,7 +671,7 @@ int CtdlIPCGetSingleMessage(CtdlIPC * ipc, long msgnum, int headers, int as_mime
                                        if (!strncasecmp(bbb, "Content-type:", 13)) {
                                                extract_token(mret[0]->content_type, bbb, 0, '\n', sizeof mret[0]->content_type);
                                                strcpy(mret[0]->content_type, &mret[0]->content_type[13]);
-                                               striplt(mret[0]->content_type);
+                                               string_trim(mret[0]->content_type);
 
                                                /* strip out ";charset=" portion.  FIXME do something with
                                                 * the charset (like... convert it) instead of just throwing
@@ -685,12 +685,12 @@ int CtdlIPCGetSingleMessage(CtdlIPC * ipc, long msgnum, int headers, int as_mime
                                        if (!strncasecmp(bbb, "X-Citadel-MSG4-Partnum:", 23)) {
                                                extract_token(mret[0]->mime_chosen, bbb, 0, '\n', sizeof mret[0]->mime_chosen);
                                                strcpy(mret[0]->mime_chosen, &mret[0]->mime_chosen[23]);
-                                               striplt(mret[0]->mime_chosen);
+                                               string_trim(mret[0]->mime_chosen);
                                        }
                                        if (!strncasecmp(bbb, "Content-transfer-encoding:", 26)) {
                                                extract_token(encoding, bbb, 0, '\n', sizeof encoding);
                                                strcpy(encoding, &encoding[26]);
-                                               striplt(encoding);
+                                               string_trim(encoding);
                                        }
                                        remove_token(bbb, 0, '\n');
                                } while ((bbb[0] != 0) && (bbb[0] != '\n'));
index 17edb3393f7068c7420e148224eb1928a1548f04..dcb6f143682b7f82723db2081e6f886049a025a8 100644 (file)
@@ -248,7 +248,7 @@ void check_attendee_availability(icalcomponent *vevent) {
 
                        /** screen name or email address */
                        safestrncpy(attendee_string, ch + 7, sizeof(attendee_string));
-                       striplt(attendee_string);
+                       string_trim(attendee_string);
 
                        check_individual_attendee(attendee_string,
                                                dtstart_t, dtend_t,
index 1185bfc22d233dbb8bda5e3d94573a1443ad63b0..f0f34ef84e05a4344b449df7032f2cbf2a7394d2 100644 (file)
@@ -175,7 +175,7 @@ void cal_process_object(StrBuf *Target,
 
                        // screen name or email address
                        safestrncpy(buf, ch + 7, sizeof(buf));
-                       striplt(buf);
+                       string_trim(buf);
                        StrEscAppend(Target, NULL, buf, 0, 0);
                        StrBufAppendPrintf(Target, " ");
 
@@ -683,11 +683,11 @@ void load_ical_object(long msgnum, int unread,
                        if (!IsEmptyStr(bptr)) {
                                if (!strncasecmp(bptr, "Content-type: ", 14)) {
                                        safestrncpy(msg4_content_type, &bptr[14], sizeof msg4_content_type);
-                                       striplt(msg4_content_type);
+                                       string_trim(msg4_content_type);
                                }
                                else if (!strncasecmp(bptr, "Content-transfer-encoding: ", 27)) {
                                        safestrncpy(msg4_content_encoding, &bptr[27], sizeof msg4_content_encoding);
-                                       striplt(msg4_content_type);
+                                       string_trim(msg4_content_type);
                                }
                                else if ((!strncasecmp(bptr, "Content-length: ", 16))) {
                                        msg4_content_length = atoi(&bptr[16]);
index 73f0c5514bbc2fd9a8e1e7d3fcbba2e88eaa6cbb..9c57f52ad0cde7c1430dd2a4127cc91ea3b6852c 100644 (file)
@@ -201,15 +201,15 @@ void dav_get(void)
                if (!in_body) {
                        if (!strncasecmp(buf, "Date:", 5)) {
                                safestrncpy(date, &buf[5], sizeof date);
-                               striplt(date);
+                               string_trim(date);
                        }
                        if (!strncasecmp(buf, "Content-type:", 13)) {
                                safestrncpy(content_type, &buf[13], sizeof content_type);
-                               striplt(content_type);
+                               string_trim(content_type);
                                ptr = bmstrcasestr(&buf[13], "charset=");
                                if (ptr) {
                                        safestrncpy(charset, ptr+8, sizeof charset);
-                                       striplt(charset);
+                                       string_trim(charset);
                                        endptr = strchr(charset, ';');
                                        if (endptr != NULL) strcpy(endptr, "");
                                }
index d786998ab8ef818c0d5bebf7e15b291c1b04b7e1..e2894d1dc4e07311c25719a120ef08968a190393 100644 (file)
@@ -359,7 +359,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
                strcpy(organizer_string, icalproperty_get_organizer(organizer));
                if (!strncasecmp(organizer_string, "mailto:", 7)) {
                        strcpy(organizer_string, &organizer_string[7]);
-                       striplt(organizer_string);
+                       string_trim(organizer_string);
                        serv_printf("ISME %s", organizer_string);
                        serv_getln(buf, sizeof buf);
                        if (buf[0] == '2') {
@@ -470,7 +470,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
 
                        /* screen name or email address */
                        safestrncpy(attendee_string, ch + 7, sizeof(attendee_string));
-                       striplt(attendee_string);
+                       string_trim(attendee_string);
                        if (i++) wc_printf("\n");
                        escputs(attendee_string);
                        wc_printf(" ");
@@ -1098,7 +1098,7 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *fr
                /* Now iterate! */
                for (i=0; i<num_tokens(form_attendees, '\n'); ++i) {
                        extract_token(buf, form_attendees, i, '\n', sizeof buf);
-                       striplt(buf);
+                       string_trim(buf);
                        if (!IsEmptyStr(buf)) {
                                sprintf(attendee_string, "MAILTO:%s", buf);
                                foundit = 0;
@@ -1125,11 +1125,11 @@ STARTOVER:      for (attendee = icalcomponent_get_first_property(vevent, ICAL_ATTENDE
                        ch = icalproperty_get_attendee(attendee);
                        if ((ch != NULL) && !strncasecmp(ch, "MAILTO:", 7)) {
                                safestrncpy(attendee_string, ch + 7, sizeof(attendee_string));
-                               striplt(attendee_string);
+                               string_trim(attendee_string);
                                foundit = 0;
                                for (i=0; i<num_tokens(form_attendees, '\n'); ++i) {
                                        extract_token(buf, form_attendees, i, '\n', sizeof buf);
-                                       striplt(buf);
+                                       string_trim(buf);
                                        if (!strcasecmp(buf, attendee_string)) ++foundit;
                                }
                                if (foundit == 0) {
index ca2404385505ff14f1890d9d4114959e6eec9221..3122c75ac45f23c97ada09c15770a635d81ce2d4 100644 (file)
@@ -59,7 +59,7 @@ void extract_charset_from_meta(char *charset, char *meta_http_equiv, char *meta_
        if (!ptr) return;
 
        safestrncpy(buf, ++ptr, sizeof buf);
-       striplt(buf);
+       string_trim(buf);
        if (!strncasecmp(buf, "charset=", 8)) {
                strcpy(charset, &buf[8]);
 
@@ -76,7 +76,7 @@ void extract_charset_from_meta(char *charset, char *meta_http_equiv, char *meta_
 
                /* Remove wandering punctuation */
                if ((ptr=strchr(charset, '\"'))) *ptr = 0;
-               striplt(charset);
+               string_trim(charset);
        }
 }
 
@@ -187,7 +187,7 @@ void output_html(const char *supplied_charset, int treat_as_wiki, int msgnum, St
                                meta = malloc(meta_length + 1);
                                safestrncpy(meta, meta_start, meta_length);
                                meta[meta_length] = 0;
-                               striplt(meta);
+                               string_trim(meta);
                                if (!strncasecmp(meta, "HTTP-EQUIV=", 11)) {
                                        meta_http_equiv = strdup(&meta[11]);
                                        spaceptr = strchr(meta_http_equiv, ' ');
index 079bb960b687d7b49e463e3bd5a2138841e4805c..584e8d99704b37f39da63087d3a3d1866c7c529c 100644 (file)
@@ -78,11 +78,11 @@ struct vnote *vnote_new_from_msg(long msgnum,int unread)
                        if (!IsEmptyStr(bptr)) {
                                if (!strncasecmp(bptr, "Content-type: ", 14)) {
                                        safestrncpy(msg4_content_type, &bptr[14], sizeof msg4_content_type);
-                                       striplt(msg4_content_type);
+                                       string_trim(msg4_content_type);
                                }
                                else if (!strncasecmp(bptr, "Content-transfer-encoding: ", 27)) {
                                        safestrncpy(msg4_content_encoding, &bptr[27], sizeof msg4_content_encoding);
-                                       striplt(msg4_content_type);
+                                       string_trim(msg4_content_type);
                                }
                                else if ((!strncasecmp(bptr, "Content-length: ", 16))) {
                                        msg4_content_length = atoi(&bptr[16]);
index a5b019f5453545fd3d4d5667387fa0b3d78a0731..059eadf8071d9739f961b505eb570263fea2d6b0 100644 (file)
@@ -1179,7 +1179,7 @@ void netedit(void) {
                        for (i=0; i<num_addrs; ++i) {
                                strcpy(line, bstr("prefix"));
                                extract_token(buf, bstr("line"), i, ',', sizeof buf);
-                               striplt(buf);
+                               string_trim(buf);
                                strcat(line, buf);
                                strcat(line, bstr("suffix"));
                                serv_puts(line);
index 80371dc9f4e9ef6a368192a3158b0f1aa8873e26..05cab0d453ac7e394e56cd17e3bf716e39c66cc8 100644 (file)
@@ -800,7 +800,7 @@ void edituser(void) {
                }
 
                /* Remove any naughty inappropriate whitespace */
-               striplt(all_the_emails);
+               string_trim(all_the_emails);
                while (pos = strstr(all_the_emails, "\n,"), (pos != NULL)) {
                        strcpy(pos, pos+1);
                }