From 5152040c17eef73134b5417d3f8ae53d7bc9f06d Mon Sep 17 00:00:00 2001 From: Arnavion Date: Sat, 6 Dec 2014 14:02:45 -0800 Subject: Always use 64-bit filesize and file offsets in DCC. Based on LRN's commit for replacing stat with GFileInfo https://github.com/hexchat/hexchat/commit/32008bb Fixes #382 --- src/common/plugin.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/common/plugin.c') diff --git a/src/common/plugin.c b/src/common/plugin.c index d83b69ff..f386346e 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -1531,7 +1531,14 @@ hexchat_list_int (hexchat_plugin *ph, hexchat_list *xlist, const char *name) case 0x34207553: /* address32 */ return ((struct DCC *)data)->addr; case 0x181a6: /* cps */ - return ((struct DCC *)data)->cps; + { + gint64 cps = ((struct DCC *)data)->cps; + if (cps <= INT_MAX) + { + return (int) cps; + } + return INT_MAX; + } case 0x349881: /* port */ return ((struct DCC *)data)->port; case 0x1b254: /* pos */ -- cgit 1.4.1