@matheusbsbs / matheus-bagliano / commits / 9f1ad541f9
Fork 0

imap-send.c: more style fixes

The previous one sqeezed unnecessary whitespaces and joined function type and name in the definition split across lines. This patch further fixes many remaining style issues: - We are not particularly fond of typedef to hide the underlying struct definitions. - Asterisk comes next variable, i.e. "type *var", not "type * var" nor "type* var". - Casting to pointer to a type is "(type *)", not "(type*)". - An open brace comes on the same line as closing parenthesis of "if (...)" condition; "else" comes on the same line as closing brace of its corresponding "if (...) {". - Avoid single liner "if (...) <stmt>;"; they should be on two separate lines. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jul 9, 2008 at 16:37 UTC 9f1ad541f95cf6b9024683c8883bfb0ca86f9a3d
1 file changed +111 -114
imap-send.c
+111 -114
@@ -27,70 +27,70 @@
27 typedef void *SSL;
28 #endif
29
30 -typedef struct store_conf {
30 +struct store_conf {
31 char *name;
32 const char *path; /* should this be here? its interpretation is driver-specific */
33 char *map_inbox;
34 char *trash;
35 unsigned max_size; /* off_t is overkill */
36 unsigned trash_remote_new:1, trash_only_new:1;
37 -} store_conf_t;
37 +};
38
39 -typedef struct string_list {
39 +struct string_list {
40 struct string_list *next;
41 char string[1];
42 -} string_list_t;
42 +};
43
44 -typedef struct channel_conf {
44 +struct channel_conf {
45 struct channel_conf *next;
46 char *name;
47 - store_conf_t *master, *slave;
47 + struct store_conf *master, *slave;
48 char *master_name, *slave_name;
49 char *sync_state;
50 - string_list_t *patterns;
50 + struct string_list *patterns;
51 int mops, sops;
52 unsigned max_messages; /* for slave only */
53 -} channel_conf_t;
53 +};
54
55 -typedef struct group_conf {
55 +struct group_conf {
56 struct group_conf *next;
57 char *name;
58 - string_list_t *channels;
59 -} group_conf_t;
58 + struct string_list *channels;
59 +};
60
61 /* For message->status */
62 #define M_RECENT (1<<0) /* unsyncable flag; maildir_* depend on this being 1<<0 */
63 #define M_DEAD (1<<1) /* expunged */
64 #define M_FLAGS (1<<2) /* flags fetched */
65
66 -typedef struct message {
66 +struct message {
67 struct message *next;
68 - /* string_list_t *keywords; */
68 + /* struct string_list *keywords; */
69 size_t size; /* zero implies "not fetched" */
70 int uid;
71 unsigned char flags, status;
72 -} message_t;
72 +};
73
74 -typedef struct store {
75 - store_conf_t *conf; /* foreign */
74 +struct store {
75 + struct store_conf *conf; /* foreign */
76
77 /* currently open mailbox */
78 const char *name; /* foreign! maybe preset? */
79 char *path; /* own */
80 - message_t *msgs; /* own */
80 + struct message *msgs; /* own */
81 int uidvalidity;
82 unsigned char opts; /* maybe preset? */
83 /* note that the following do _not_ reflect stats from msgs, but mailbox totals */
84 int count; /* # of messages */
85 int recent; /* # of recent messages - don't trust this beyond the initial read */
86 -} store_t;
86 +};
87
88 -typedef struct {
88 +struct msg_data {
89 char *data;
90 int len;
91 unsigned char flags;
92 unsigned int crlf:1;
93 -} msg_data_t;
93 +};
94
95 #define DRV_OK 0
96 #define DRV_MSG_BAD -1
@@ -104,7 +104,7 @@ static void imap_warn(const char *, ...);
104
105 static char *next_arg(char **);
106
107 -static void free_generic_messages(message_t *);
107 +static void free_generic_messages(struct message *);
108
109 static int nfsnprintf(char *buf, int blen, const char *fmt, ...);
110
@@ -125,7 +125,7 @@ static int nfvasprintf(char **strp, const char *fmt, va_list ap)
125 static void arc4_init(void);
126 static unsigned char arc4_getbyte(void);
127
128 -typedef struct imap_server_conf {
128 +struct imap_server_conf {
129 char *name;
130 char *tunnel;
131 char *host;
@@ -134,58 +134,58 @@ typedef struct imap_server_conf {
134 char *pass;
135 int use_ssl;
136 int ssl_verify;
137 -} imap_server_conf_t;
137 +};
138
139 -typedef struct imap_store_conf {
140 - store_conf_t gen;
141 - imap_server_conf_t *server;
139 +struct imap_store_conf {
140 + struct store_conf gen;
141 + struct imap_server_conf *server;
142 unsigned use_namespace:1;
143 -} imap_store_conf_t;
143 +};
144
145 -#define NIL (void*)0x1
146 -#define LIST (void*)0x2
145 +#define NIL (void *)0x1
146 +#define LIST (void *)0x2
147
148 -typedef struct _list {
149 - struct _list *next, *child;
148 +struct imap_list {
149 + struct imap_list *next, *child;
150 char *val;
151 int len;
152 -} list_t;
152 +};
153
154 -typedef struct {
154 +struct imap_socket {
155 int fd;
156 SSL *ssl;
157 -} Socket_t;
157 +};
158
159 -typedef struct {
160 - Socket_t sock;
159 +struct imap_buffer {
160 + struct imap_socket sock;
161 int bytes;
162 int offset;
163 char buf[1024];
164 -} buffer_t;
164 +};
165
166 struct imap_cmd;
167
168 -typedef struct imap {
168 +struct imap {
169 int uidnext; /* from SELECT responses */
170 - list_t *ns_personal, *ns_other, *ns_shared; /* NAMESPACE info */
170 + struct imap_list *ns_personal, *ns_other, *ns_shared; /* NAMESPACE info */
171 unsigned caps, rcaps; /* CAPABILITY results */
172 /* command queue */
173 int nexttag, num_in_progress, literal_pending;
174 struct imap_cmd *in_progress, **in_progress_append;
175 - buffer_t buf; /* this is BIG, so put it last */
176 -} imap_t;
175 + struct imap_buffer buf; /* this is BIG, so put it last */
176 +};
177
178 -typedef struct imap_store {
179 - store_t gen;
178 +struct imap_store {
179 + struct store gen;
180 int uidvalidity;
181 - imap_t *imap;
181 + struct imap *imap;
182 const char *prefix;
183 unsigned /*currentnc:1,*/ trashnc:1;
184 -} imap_store_t;
184 +};
185
186 struct imap_cmd_cb {
187 - int (*cont)(imap_store_t *ctx, struct imap_cmd *cmd, const char *prompt);
188 - void (*done)(imap_store_t *ctx, struct imap_cmd *cmd, int response);
187 + int (*cont)(struct imap_store *ctx, struct imap_cmd *cmd, const char *prompt);
188 + void (*done)(struct imap_store *ctx, struct imap_cmd *cmd, int response);
189 void *ctx;
190 char *data;
191 int dlen;
@@ -222,7 +222,7 @@ static const char *cap_list[] = {
222 #define RESP_NO 1
223 #define RESP_BAD 2
224
225 -static int get_cmd_result(imap_store_t *ctx, struct imap_cmd *tcmd);
225 +static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd);
226
227
228 static const char *Flags[] = {
@@ -240,7 +240,7 @@ static void ssl_socket_perror(const char *func)
240 }
241 #endif
242
243 -static void socket_perror(const char *func, Socket_t *sock, int ret)
243 +static void socket_perror(const char *func, struct imap_socket *sock, int ret)
244 {
245 #ifndef NO_OPENSSL
246 if (sock->ssl) {
@@ -265,7 +265,7 @@ static void socket_perror(const char *func, Socket_t *sock, int ret)
265 }
266 }
267
268 -static int ssl_socket_connect(Socket_t *sock, int use_tls_only, int verify)
268 +static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int verify)
269 {
270 #ifdef NO_OPENSSL
271 fprintf(stderr, "SSL requested but SSL support not compiled in\n");
@@ -317,7 +317,7 @@ static int ssl_socket_connect(Socket_t *sock, int use_tls_only, int verify)
317 #endif
318 }
319
320 -static int socket_read(Socket_t *sock, char *buf, int len)
320 +static int socket_read(struct imap_socket *sock, char *buf, int len)
321 {
322 ssize_t n;
323 #ifndef NO_OPENSSL
@@ -334,7 +334,7 @@ static int socket_read(Socket_t *sock, char *buf, int len)
334 return n;
335 }
336
337 -static int socket_write(Socket_t *sock, const char *buf, int len)
337 +static int socket_write(struct imap_socket *sock, const char *buf, int len)
338 {
339 int n;
340 #ifndef NO_OPENSSL
@@ -351,7 +351,7 @@ static int socket_write(Socket_t *sock, const char *buf, int len)
351 return n;
352 }
353
354 -static void socket_shutdown(Socket_t *sock)
354 +static void socket_shutdown(struct imap_socket *sock)
355 {
356 #ifndef NO_OPENSSL
357 if (sock->ssl) {
@@ -363,7 +363,7 @@ static void socket_shutdown(Socket_t *sock)
363 }
364
365 /* simple line buffering */
366 -static int buffer_gets(buffer_t * b, char **s)
366 +static int buffer_gets(struct imap_buffer *b, char **s)
367 {
368 int n;
369 int start = b->offset;
@@ -465,9 +465,9 @@ static char *next_arg(char **s)
465 return ret;
466 }
467
468 -static void free_generic_messages(message_t *msgs)
468 +static void free_generic_messages(struct message *msgs)
469 {
470 - message_t *tmsg;
470 + struct message *tmsg;
471
472 for (; msgs; msgs = tmsg) {
473 tmsg = msgs->next;
@@ -533,11 +533,11 @@ static unsigned char arc4_getbyte(void)
533 return rs.s[(si + sj) & 0xff];
534 }
535
536 -static struct imap_cmd *v_issue_imap_cmd(imap_store_t *ctx,
536 +static struct imap_cmd *v_issue_imap_cmd(struct imap_store *ctx,
537 struct imap_cmd_cb *cb,
538 const char *fmt, va_list ap)
539 {
540 - imap_t *imap = ctx->imap;
540 + struct imap *imap = ctx->imap;
541 struct imap_cmd *cmd;
542 int n, bufl;
543 char buf[1024];
@@ -577,8 +577,7 @@ static struct imap_cmd *v_issue_imap_cmd(imap_store_t *ctx,
577 n = socket_write(&imap->buf.sock, cmd->cb.data, cmd->cb.dlen);
578 free(cmd->cb.data);
579 if (n != cmd->cb.dlen ||
580 - (n = socket_write(&imap->buf.sock, "\r\n", 2)) != 2)
581 - {
580 + (n = socket_write(&imap->buf.sock, "\r\n", 2)) != 2) {
581 free(cmd->cmd);
582 free(cmd);
583 return NULL;
@@ -595,7 +594,7 @@ static struct imap_cmd *v_issue_imap_cmd(imap_store_t *ctx,
594 return cmd;
595 }
596
598 -static struct imap_cmd *issue_imap_cmd(imap_store_t *ctx,
597 +static struct imap_cmd *issue_imap_cmd(struct imap_store *ctx,
598 struct imap_cmd_cb *cb,
599 const char *fmt, ...)
600 {
@@ -608,7 +607,7 @@ static struct imap_cmd *issue_imap_cmd(imap_store_t *ctx,
607 return ret;
608 }
609
611 -static int imap_exec(imap_store_t *ctx, struct imap_cmd_cb *cb,
610 +static int imap_exec(struct imap_store *ctx, struct imap_cmd_cb *cb,
611 const char *fmt, ...)
612 {
613 va_list ap;
@@ -623,7 +622,7 @@ static int imap_exec(imap_store_t *ctx, struct imap_cmd_cb *cb,
622 return get_cmd_result(ctx, cmdp);
623 }
624
626 -static int imap_exec_m(imap_store_t *ctx, struct imap_cmd_cb *cb,
625 +static int imap_exec_m(struct imap_store *ctx, struct imap_cmd_cb *cb,
626 const char *fmt, ...)
627 {
628 va_list ap;
@@ -642,19 +641,19 @@ static int imap_exec_m(imap_store_t *ctx, struct imap_cmd_cb *cb,
641 }
642 }
643
645 -static int is_atom(list_t *list)
644 +static int is_atom(struct imap_list *list)
645 {
646 return list && list->val && list->val != NIL && list->val != LIST;
647 }
648
650 -static int is_list(list_t *list)
649 +static int is_list(struct imap_list *list)
650 {
651 return list && list->val == LIST;
652 }
653
655 -static void free_list(list_t *list)
654 +static void free_list(struct imap_list *list)
655 {
657 - list_t *tmp;
656 + struct imap_list *tmp;
657
658 for (; list; list = tmp) {
659 tmp = list->next;
@@ -666,9 +665,9 @@ static void free_list(list_t *list)
665 }
666 }
667
669 -static int parse_imap_list_l(imap_t *imap, char **sp, list_t **curp, int level)
668 +static int parse_imap_list_l(struct imap *imap, char **sp, struct imap_list **curp, int level)
669 {
671 - list_t *cur;
670 + struct imap_list *cur;
671 char *s = *sp, *p;
672 int n, bytes;
673
@@ -737,11 +736,10 @@ static int parse_imap_list_l(imap_t *imap, char **sp, list_t **curp, int level)
736 if (level && *s == ')')
737 break;
738 cur->len = s - p;
740 - if (cur->len == 3 && !memcmp("NIL", p, 3)) {
739 + if (cur->len == 3 && !memcmp("NIL", p, 3))
740 cur->val = NIL;
742 - } else {
741 + else
742 cur->val = xmemdupz(p, cur->len);
744 - }
743 }
744
745 if (!level)
@@ -753,14 +751,14 @@ static int parse_imap_list_l(imap_t *imap, char **sp, list_t **curp, int level)
751 *curp = NULL;
752 return 0;
753
756 - bail:
754 +bail:
755 *curp = NULL;
756 return -1;
757 }
758
761 -static list_t *parse_imap_list(imap_t *imap, char **sp)
759 +static struct imap_list *parse_imap_list(struct imap *imap, char **sp)
760 {
763 - list_t *head;
761 + struct imap_list *head;
762
763 if (!parse_imap_list_l(imap, sp, &head, 0))
764 return head;
@@ -768,12 +766,12 @@ static list_t *parse_imap_list(imap_t *imap, char **sp)
766 return NULL;
767 }
768
771 -static list_t *parse_list(char **sp)
769 +static struct imap_list *parse_list(char **sp)
770 {
771 return parse_imap_list(NULL, sp);
772 }
773
776 -static void parse_capability(imap_t *imap, char *cmd)
774 +static void parse_capability(struct imap *imap, char *cmd)
775 {
776 char *arg;
777 unsigned i;
@@ -786,10 +784,10 @@ static void parse_capability(imap_t *imap, char *cmd)
784 imap->rcaps = imap->caps;
785 }
786
789 -static int parse_response_code(imap_store_t *ctx, struct imap_cmd_cb *cb,
787 +static int parse_response_code(struct imap_store *ctx, struct imap_cmd_cb *cb,
788 char *s)
789 {
792 - imap_t *imap = ctx->imap;
790 + struct imap *imap = ctx->imap;
791 char *arg, *p;
792
793 if (*s != '[')
@@ -821,8 +819,7 @@ static int parse_response_code(imap_store_t *ctx, struct imap_cmd_cb *cb,
819 fprintf(stderr, "*** IMAP ALERT *** %s\n", p);
820 } else if (cb && cb->ctx && !strcmp("APPENDUID", arg)) {
821 if (!(arg = next_arg(&s)) || !(ctx->gen.uidvalidity = atoi(arg)) ||
824 - !(arg = next_arg(&s)) || !(*(int *)cb->ctx = atoi(arg)))
825 - {
822 + !(arg = next_arg(&s)) || !(*(int *)cb->ctx = atoi(arg))) {
823 fprintf(stderr, "IMAP error: malformed APPENDUID status\n");
824 return RESP_BAD;
825 }
@@ -830,9 +827,9 @@ static int parse_response_code(imap_store_t *ctx, struct imap_cmd_cb *cb,
827 return RESP_OK;
828 }
829
833 -static int get_cmd_result(imap_store_t *ctx, struct imap_cmd *tcmd)
830 +static int get_cmd_result(struct imap_store *ctx, struct imap_cmd *tcmd)
831 {
835 - imap_t *imap = ctx->imap;
832 + struct imap *imap = ctx->imap;
833 struct imap_cmd *cmdp, **pcmdp, *ncmdp;
834 char *cmd, *arg, *arg1, *p;
835 int n, resp, resp2, tag;
@@ -902,7 +899,7 @@ static int get_cmd_result(imap_store_t *ctx, struct imap_cmd *tcmd)
899 goto gottag;
900 fprintf(stderr, "IMAP error: unexpected tag %s\n", arg);
901 return RESP_BAD;
905 - gottag:
902 + gottag:
903 if (!(*pcmdp = cmdp->next))
904 imap->in_progress_append = pcmdp;
905 imap->num_in_progress--;
@@ -944,7 +941,7 @@ static int get_cmd_result(imap_store_t *ctx, struct imap_cmd *tcmd)
941 }
942 if ((resp2 = parse_response_code(ctx, &cmdp->cb, cmd)) > resp)
943 resp = resp2;
947 - normal:
944 + normal:
945 if (cmdp->cb.done)
946 cmdp->cb.done(ctx, cmdp, resp);
947 free(cmdp->cb.data);
@@ -957,9 +954,9 @@ static int get_cmd_result(imap_store_t *ctx, struct imap_cmd *tcmd)
954 /* not reached */
955 }
956
960 -static void imap_close_server(imap_store_t *ictx)
957 +static void imap_close_server(struct imap_store *ictx)
958 {
962 - imap_t *imap = ictx->imap;
959 + struct imap *imap = ictx->imap;
960
961 if (imap->buf.sock.fd != -1) {
962 imap_exec(ictx, NULL, "LOGOUT");
@@ -971,17 +968,17 @@ static void imap_close_server(imap_store_t *ictx)
968 free(imap);
969 }
970
974 -static void imap_close_store(store_t *ctx)
971 +static void imap_close_store(struct store *ctx)
972 {
976 - imap_close_server((imap_store_t *)ctx);
973 + imap_close_server((struct imap_store *)ctx);
974 free_generic_messages(ctx->msgs);
975 free(ctx);
976 }
977
981 -static store_t *imap_open_store(imap_server_conf_t *srvc)
978 +static struct store *imap_open_store(struct imap_server_conf *srvc)
979 {
983 - imap_store_t *ctx;
984 - imap_t *imap;
980 + struct imap_store *ctx;
981 + struct imap *imap;
982 char *arg, *rsp;
983 struct hostent *he;
984 struct sockaddr_in addr;
@@ -1117,8 +1114,8 @@ static store_t *imap_open_store(imap_server_conf_t *srvc)
1114 goto bail;
1115 }
1116 if (!imap->buf.sock.ssl)
1120 - imap_warn( "*** IMAP Warning *** Password is being "
1121 - "sent in the clear\n" );
1117 + imap_warn("*** IMAP Warning *** Password is being "
1118 + "sent in the clear\n");
1119 if (imap_exec(ctx, NULL, "LOGIN \"%s\" \"%s\"", srvc->user, srvc->pass) != RESP_OK) {
1120 fprintf(stderr, "IMAP error: LOGIN failed\n");
1121 goto bail;
@@ -1127,9 +1124,9 @@ static store_t *imap_open_store(imap_server_conf_t *srvc)
1124
1125 ctx->prefix = "";
1126 ctx->trashnc = 1;
1130 - return (store_t *)ctx;
1127 + return (struct store *)ctx;
1128
1132 - bail:
1129 +bail:
1130 imap_close_store(&ctx->gen);
1131 return NULL;
1132 }
@@ -1153,10 +1150,10 @@ static int imap_make_flags(int flags, char *buf)
1150
1151 #define TUIDL 8
1152
1156 -static int imap_store_msg(store_t *gctx, msg_data_t *data, int *uid)
1153 +static int imap_store_msg(struct store *gctx, struct msg_data *data, int *uid)
1154 {
1158 - imap_store_t *ctx = (imap_store_t *)gctx;
1159 - imap_t *imap = ctx->imap;
1155 + struct imap_store *ctx = (struct imap_store *)gctx;
1156 + struct imap *imap = ctx->imap;
1157 struct imap_cmd_cb cb;
1158 char *fmap, *buf;
1159 const char *prefix, *box;
@@ -1171,7 +1168,7 @@ static int imap_store_msg(store_t *gctx, msg_data_t *data, int *uid)
1168 nocr = !data->crlf;
1169 extra = 0, i = 0;
1170 if (!CAP(UIDPLUS) && uid) {
1174 - nloop:
1171 + nloop:
1172 start = i;
1173 while (i < len)
1174 if (fmap[i++] == '\n') {
@@ -1189,7 +1186,7 @@ static int imap_store_msg(store_t *gctx, msg_data_t *data, int *uid)
1186 /* invalid message */
1187 free(fmap);
1188 return DRV_MSG_BAD;
1192 - mktid:
1189 + mktid:
1190 for (j = 0; j < TUIDL; j++)
1191 sprintf(tuid + j * 2, "%02x", arc4_getbyte());
1192 extra += 8 + TUIDL * 2 + 2;
@@ -1267,7 +1264,7 @@ static int imap_store_msg(store_t *gctx, msg_data_t *data, int *uid)
1264
1265 #define CHUNKSIZE 0x1000
1266
1270 -static int read_message(FILE *f, msg_data_t *msg)
1267 +static int read_message(FILE *f, struct msg_data *msg)
1268 {
1269 struct strbuf buf;
1270
@@ -1284,7 +1281,7 @@ static int read_message(FILE *f, msg_data_t *msg)
1281 return msg->len;
1282 }
1283
1287 -static int count_messages(msg_data_t *msg)
1284 +static int count_messages(struct msg_data *msg)
1285 {
1286 int count = 0;
1287 char *p = msg->data;
@@ -1302,7 +1299,7 @@ static int count_messages(msg_data_t *msg)
1299 return count;
1300 }
1301
1305 -static int split_msg(msg_data_t *all_msgs, msg_data_t *msg, int *ofs)
1302 +static int split_msg(struct msg_data *all_msgs, struct msg_data *msg, int *ofs)
1303 {
1304 char *p, *data;
1305
@@ -1333,7 +1330,7 @@ static int split_msg(msg_data_t *all_msgs, msg_data_t *msg, int *ofs)
1330 return 1;
1331 }
1332
1336 -static imap_server_conf_t server = {
1333 +static struct imap_server_conf server = {
1334 NULL, /* name */
1335 NULL, /* tunnel */
1336 NULL, /* host */
@@ -1370,8 +1367,7 @@ static int git_imap_config(const char *key, const char *val, void *cb)
1367 if (!prefixcmp(val, "//"))
1368 val += 2;
1369 server.host = xstrdup(val);
1373 - }
1374 - else if (!strcmp("user", key))
1370 + } else if (!strcmp("user", key))
1371 server.user = xstrdup(val);
1372 else if (!strcmp("pass", key))
1373 server.pass = xstrdup(val);
@@ -1386,8 +1382,8 @@ static int git_imap_config(const char *key, const char *val, void *cb)
1382
1383 int main(int argc, char **argv)
1384 {
1389 - msg_data_t all_msgs, msg;
1390 - store_t *ctx = NULL;
1385 + struct msg_data all_msgs, msg;
1386 + struct store *ctx = NULL;
1387 int uid = 0;
1388 int ofs = 0;
1389 int r;
@@ -1417,24 +1413,24 @@ int main(int argc, char **argv)
1413
1414 /* read the messages */
1415 if (!read_message(stdin, &all_msgs)) {
1420 - fprintf(stderr,"nothing to send\n");
1416 + fprintf(stderr, "nothing to send\n");
1417 return 1;
1418 }
1419
1420 total = count_messages(&all_msgs);
1421 if (!total) {
1426 - fprintf(stderr,"no messages to send\n");
1422 + fprintf(stderr, "no messages to send\n");
1423 return 1;
1424 }
1425
1426 /* write it to the imap server */
1427 ctx = imap_open_store(&server);
1428 if (!ctx) {
1433 - fprintf(stderr,"failed to open store\n");
1429 + fprintf(stderr, "failed to open store\n");
1430 return 1;
1431 }
1432
1437 - fprintf(stderr, "sending %d message%s\n", total, (total!=1)?"s":"");
1433 + fprintf(stderr, "sending %d message%s\n", total, (total != 1) ? "s" : "");
1434 ctx->name = imap_folder;
1435 while (1) {
1436 unsigned percent = n * 100 / total;
@@ -1442,7 +1438,8 @@ int main(int argc, char **argv)
1438 if (!split_msg(&all_msgs, &msg, &ofs))
1439 break;
1440 r = imap_store_msg(ctx, &msg, &uid);
1445 - if (r != DRV_OK) break;
1441 + if (r != DRV_OK)
1442 + break;
1443 n++;
1444 }
1445 fprintf(stderr, "\n");