Skip to content

Commit

Permalink
emsmdb: adjust fx_divisor to return size_t
Browse files Browse the repository at this point in the history
For synchronization streams over 281470681743360 bytes (255.996 TB)
in length, fx_divisor would return the wrong value, which could
probably lead to funky progress bars in Outlook.
  • Loading branch information
jengelh committed Dec 25, 2023
1 parent f995029 commit ca14fdc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions exch/emsmdb/common_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ extern unsigned int g_max_rcpt, g_max_message, g_max_mail_len;
extern unsigned int g_max_rule_len, g_max_extrule_len;
extern char g_emsmdb_org_name[256];

static inline uint32_t fx_divisor(uint64_t total)
static inline size_t fx_divisor(size_t total)
{
uint32_t r = total / 0xFFFF;
size_t r = total / 0xFFFF;
return r > 0 ? r : 1;
}
2 changes: 1 addition & 1 deletion exch/emsmdb/fastdownctx_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ struct fastdownctx_object final {
EID_ARRAY *pmsglst = nullptr;
std::unique_ptr<FOLDER_CONTENT> pfldctnt;
fxdown_flow_list flow_list;
uint32_t total_steps = 0, progress_steps = 0, divisor = 1;
size_t total_steps = 0, progress_steps = 0, divisor = 1;
};

0 comments on commit ca14fdc

Please sign in to comment.