mirror of
https://github.com/git/git.git
synced 2024-11-28 04:23:30 +08:00
Avoid a divide by zero if there's no messages to send.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
521a3f6767
commit
1cd88cc9e6
@ -1332,6 +1332,12 @@ main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
total = count_messages( &all_msgs );
|
||||
if (!total) {
|
||||
fprintf(stderr,"no messages to send\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* write it to the imap server */
|
||||
ctx = imap_open_store( &server );
|
||||
if (!ctx) {
|
||||
@ -1339,7 +1345,6 @@ main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
total = count_messages( &all_msgs );
|
||||
fprintf( stderr, "sending %d message%s\n", total, (total!=1)?"s":"" );
|
||||
ctx->name = imap_folder;
|
||||
while (1) {
|
||||
|
Loading…
Reference in New Issue
Block a user