diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/HPM.c | 2 | ||||
-rw-r--r-- | src/common/grfio.c | 13 | ||||
-rw-r--r-- | src/common/socket.c | 7 |
3 files changed, 14 insertions, 8 deletions
diff --git a/src/common/HPM.c b/src/common/HPM.c index 4802fbc61..2df559c82 100644 --- a/src/common/HPM.c +++ b/src/common/HPM.c @@ -53,7 +53,7 @@ bool hplugin_iscompatible(char* version) { if( version == NULL ) return false; - sscanf(version, "%d.%d", &req_major, &req_minor); + sscanf(version, "%u.%u", &req_major, &req_minor); return ( req_major == HPM->version[0] && req_minor <= HPM->version[1] ) ? true : false; } diff --git a/src/common/grfio.c b/src/common/grfio.c index cc2f866f7..bf66dba52 100644 --- a/src/common/grfio.c +++ b/src/common/grfio.c @@ -1,5 +1,6 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena Dev Teams #include "../common/cbasetypes.h" #include "../common/des.h" @@ -250,8 +251,12 @@ int decode_zip(void* dest, unsigned long* destLen, const void* source, unsigned /// zlib compress -int encode_zip(void* dest, unsigned long* destLen, const void* source, unsigned long sourceLen) -{ +int encode_zip(void* dest, unsigned long* destLen, const void* source, unsigned long sourceLen) { + if( *destLen == 0 ) /* [Ind/Hercules] */ + *destLen = compressBound(sourceLen); + if( dest == NULL ) { /* [Ind/Hercules] */ + CREATE(dest, unsigned char, *destLen); + } return compress((Bytef*)dest, destLen, (const Bytef*)source, sourceLen); } diff --git a/src/common/socket.c b/src/common/socket.c index 79ccdf5dc..5126d231b 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -1,5 +1,6 @@ -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// Copyright (c) Hercules Dev Team, licensed under GNU GPL. +// See the LICENSE file +// Portions Copyright (c) Athena Dev Teams #include "../common/cbasetypes.h" #include "../common/mmo.h" @@ -812,7 +813,7 @@ int do_sockets(int next) continue; // after parse, check client's RFIFO size to know if there is an invalid packet (too big and not parsed) - if (session[i]->rdata_size == RFIFO_SIZE && session[i]->max_rdata == RFIFO_SIZE) { + if (session[i]->rdata_size == session[i]->max_rdata) { set_eof(i); continue; } |