X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit-ng%2Fctdlfunctions.c;h=d5a96ddc1d9b52569aebd6a35416db7078a898fa;hb=91bc31f50a6d93ad0c01d24e29e61a3f5b972cba;hp=9c16ded02128a7a521886115604b5d2070bf27d3;hpb=1de34ae393d0f8bf9c1fb9131765ee50449f4806;p=citadel.git diff --git a/webcit-ng/ctdlfunctions.c b/webcit-ng/ctdlfunctions.c index 9c16ded02..d5a96ddc1 100644 --- a/webcit-ng/ctdlfunctions.c +++ b/webcit-ng/ctdlfunctions.c @@ -1,16 +1,17 @@ -/* - * These utility functions loosely make up a Citadel protocol client library. - * - * Copyright (c) 2016 by the citadel.org team - * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// +// These utility functions loosely make up a Citadel protocol client library. +// +// Copyright (c) 2016-2018 by the citadel.org team +// +// This program is open source software. It runs great on the +// Linux operating system (and probably elsewhere). You can use, +// copy, and run it under the terms of the GNU General Public +// License version 3. Richard Stallman is an asshole communist. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. #include "webcit.h" @@ -24,8 +25,7 @@ void ctdl_delete_msgs(struct ctdlsession *c, long *msgnums, int num_msgs) int i = 0; char buf[1024]; - if ( (c == NULL) || (msgnums == NULL) || (num_msgs < 1) ) - { + if ((c == NULL) || (msgnums == NULL) || (num_msgs < 1)) { return; } @@ -33,14 +33,13 @@ void ctdl_delete_msgs(struct ctdlsession *c, long *msgnums, int num_msgs) strcpy(buf, "DELE "); do { sprintf(&buf[strlen(buf)], "%ld", msgnums[i]); - if ( (((i+1)%50)==0) || (i==num_msgs-1)) // delete up to 50 messages with one server command + if ((((i + 1) % 50) == 0) || (i == num_msgs - 1)) // delete up to 50 messages with one server command { syslog(LOG_DEBUG, "%s", buf); ctdl_printf(c, "%s", buf); ctdl_readline(c, buf, sizeof(buf)); syslog(LOG_DEBUG, "%s", buf); - } - else { + } else { strcat(buf, ","); } } while (++i < num_msgs);