summaryrefslogtreecommitdiff
path: root/src/common/socket.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-04-02 15:26:08 -0300
committershennetsind <ind@henn.et>2013-04-02 15:26:08 -0300
commit716c400ab53268b432045b8f2883285d22ce650c (patch)
tree771f447af4c11d0acca4d2ac79d4013c0bd8bc5e /src/common/socket.c
parentc2d78c0b9e152190d3e1703fce01e02fd7cc6d34 (diff)
downloadhercules-716c400ab53268b432045b8f2883285d22ce650c.tar.gz
hercules-716c400ab53268b432045b8f2883285d22ce650c.tar.bz2
hercules-716c400ab53268b432045b8f2883285d22ce650c.tar.xz
hercules-716c400ab53268b432045b8f2883285d22ce650c.zip
Fixed Bug #7145
woo another system-dependent error (actually osx network buffer noticed the error and fixed it and that didnt let it happen while i was testing in it, nevertheless it was my fault and not windows +__+) http://hercules.ws/board/tracker/issue-7145-error-when-starting-the-emulator/ Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/common/socket.c')
-rw-r--r--src/common/socket.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/common/socket.c b/src/common/socket.c
index 701fbc685..79ccdf5dc 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -1411,20 +1411,21 @@ void socket_datasync(int fd, bool send) {
{ sizeof(struct fame_list) },
};
unsigned short i;
+ unsigned int alen = ARRAYLENGTH(data_list);
if( send ) {
- unsigned short p_len = ( sizeof(data_list) * 4 ) + 4;
+ unsigned short p_len = ( alen * 4 ) + 4;
WFIFOHEAD(fd, p_len);
WFIFOW(fd, 0) = 0x2b0a;
WFIFOW(fd, 2) = p_len;
- for( i = 0; i < sizeof(data_list); i++ ) {
+ for( i = 0; i < alen; i++ ) {
WFIFOL(fd, 4 + ( i * 4 ) ) = data_list[i].length;
}
WFIFOSET(fd, p_len);
} else {
- for( i = 0; i < sizeof(data_list); i++ ) {
+ for( i = 0; i < alen; i++ ) {
if( RFIFOL(fd, 4 + (i * 4) ) != data_list[i].length ) {
/* force the other to go wrong too so both are taken down */
WFIFOHEAD(fd, 8);
@@ -1434,7 +1435,7 @@ void socket_datasync(int fd, bool send) {
WFIFOSET(fd, 8);
flush_fifo(fd);
/* shut down */
- ShowFatalError("Servers are out of sync! recompile from scratch\n");
+ ShowFatalError("Servers are out of sync! recompile from scratch (%d)\n",i);
exit(EXIT_FAILURE);
}
}