summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/char/char.c21
-rw-r--r--src/char/int_guild.c8
-rw-r--r--src/char/int_party.c4
-rw-r--r--src/char/inter.c8
-rw-r--r--src/login/login.c2
-rw-r--r--src/login_sql/login.c2
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/mail.c2
-rw-r--r--src/map/skill.c1
9 files changed, 32 insertions, 18 deletions
diff --git a/src/char/char.c b/src/char/char.c
index b2fc12ddb..1a5fa49e8 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -2,19 +2,26 @@
// original : char2.c 2003/03/14 11:58:35 Rev.1.5
#include <sys/types.h>
-#include <sys/socket.h>
#include <stdio.h>
#include <stdlib.h>
+
+#ifdef _WIN32
+#include <winsock.h>
+typedef long in_addr_t;
+#else
+#include <sys/socket.h>
#include <netinet/in.h>
-#include <sys/time.h>
-#include <time.h>
+#include <arpa/inet.h>
+#include <netdb.h>
#include <sys/ioctl.h>
+#include <sys/time.h>
#include <unistd.h>
+#endif
+
+#include <time.h>
#include <signal.h>
#include <fcntl.h>
#include <string.h>
-#include <arpa/inet.h>
-#include <netdb.h>
#include <stdarg.h>
#include "../common/strlib.h"
@@ -1073,7 +1080,7 @@ void create_online_files(void) {
char temp[256]; // to prepare what we must display
time_t time_server; // for number of seconds
struct tm *datetime; // variable for time in structure ->tm_mday, ->tm_sec, ...
- int id[online_players_max];
+ int id[4096];
// don't return here if we display nothing, because server[j].users is updated in the first loop.
@@ -1822,7 +1829,7 @@ int parse_tologin(int fd) {
char_log("'ladmin': Receiving a message for broadcast, but no map-server is online." RETCODE);
else {
unsigned char buf[128];
- char message[RFIFOL(fd,4) + 1]; // +1 to add a null terminated if not exist in the packet
+ char message[4096]; // +1 to add a null terminated if not exist in the packet
int lp;
char *p;
memset(message, '\0', sizeof(message));
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 8b9de1a89..95f0cf099 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -731,7 +731,7 @@ int mapif_guild_noinfo(int fd, int guild_id) {
// ギルド情報まとめ送り
int mapif_guild_info(int fd, struct guild *g) {
- unsigned char buf[4 + sizeof(struct guild)];
+ unsigned char buf[2048];
WBUFW(buf,0) = 0x3831;
memcpy(buf + 4, g, sizeof(struct guild));
@@ -805,7 +805,7 @@ int mapif_guild_broken(int guild_id, int flag) {
// ギルド内発言
int mapif_guild_message(int guild_id, int account_id, char *mes, int len, int sfd) {
- unsigned char buf[len+12];
+ unsigned char buf[2048];
WBUFW(buf,0) = 0x3837;
WBUFW(buf,2) = len + 12;
@@ -832,7 +832,7 @@ int mapif_guild_basicinfochanged(int guild_id, int type, const void *data, int l
// ギルドメンバ情報変更通知
int mapif_guild_memberinfochanged(int guild_id, int account_id, int char_id, int type, const void *data, int len) {
- unsigned char buf[len + 18];
+ unsigned char buf[4096];
WBUFW(buf, 0) = 0x383a;
WBUFW(buf, 2) = len + 18;
@@ -878,7 +878,7 @@ int mapif_guild_alliance(int guild_id1, int guild_id2, int account_id1, int acco
// ギルド役職変更通知
int mapif_guild_position(struct guild *g, int idx) {
- unsigned char buf[sizeof(struct guild_position) + 12];
+ unsigned char buf[2048];
WBUFW(buf,0) = 0x383b;
WBUFW(buf,2) = sizeof(struct guild_position) + 12;
diff --git a/src/char/int_party.c b/src/char/int_party.c
index 8c87f2cb4..31f489d2e 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -281,7 +281,7 @@ int mapif_party_noinfo(int fd, int party_id) {
// パ?ティ情報まとめ送り
int mapif_party_info(int fd, struct party *p) {
- unsigned char buf[4 + sizeof(struct party)];
+ unsigned char buf[2048];
WBUFW(buf,0) = 0x3821;
memcpy(buf + 4, p, sizeof(struct party));
@@ -368,7 +368,7 @@ int mapif_party_broken(int party_id, int flag) {
// パ?ティ??言
int mapif_party_message(int party_id, int account_id, char *mes, int len, int sfd) {
- unsigned char buf[len+12];
+ unsigned char buf[2048];
WBUFW(buf,0) = 0x3827;
WBUFW(buf,2) = len + 12;
diff --git a/src/char/inter.c b/src/char/inter.c
index a6893aecc..0dca38559 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -296,7 +296,7 @@ int inter_mapif_init(int fd) {
// GMメッセージ送信
int mapif_GMmessage(unsigned char *mes, int len, int sfd) {
- unsigned char buf[len];
+ unsigned char buf[2048];
WBUFW(buf,0) = 0x3800;
WBUFW(buf,2) = len;
@@ -309,7 +309,7 @@ int mapif_GMmessage(unsigned char *mes, int len, int sfd) {
// Wisp/page transmission to all map-server
int mapif_wis_message(struct WisData *wd) {
- unsigned char buf[56 + wd->len];
+ unsigned char buf[2048];
WBUFW(buf, 0) = 0x3801;
WBUFW(buf, 2) = 56 + wd->len;
@@ -337,7 +337,7 @@ int mapif_wis_end(struct WisData *wd, int flag) {
// アカウント変数送信
int mapif_account_reg(int fd, unsigned char *src) {
- unsigned char buf[WBUFW(src,2)];
+ unsigned char buf[2048];
memcpy(WBUFP(buf,0),src,WBUFW(src,2));
WBUFW(buf, 0) = 0x3804;
@@ -489,7 +489,7 @@ int mapif_parse_WisReply(int fd) {
// Received wisp message from map-server for ALL gm (just copy the message and resends it to ALL map-servers)
int mapif_parse_WisToGM(int fd) {
- unsigned char buf[RFIFOW(fd,2)]; // 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B
+ unsigned char buf[2048]; // 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B
memcpy(WBUFP(buf,0), RFIFOP(fd,0), RFIFOW(fd,2));
WBUFW(buf, 0) = 0x3803;
diff --git a/src/login/login.c b/src/login/login.c
index 747fe0a94..7dafc7443 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -2841,6 +2841,8 @@ int parse_login(int fd) {
sprintf(ip, "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
+ memset(&account, 0, sizeof(account));
+
if (session[fd]->eof) {
close(fd);
delete_session(fd);
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index 85f08391d..414b0efda 100644
--- a/src/login_sql/login.c
+++ b/src/login_sql/login.c
@@ -1134,6 +1134,8 @@ int parse_login(int fd) {
sprintf(ip, "%d.%d.%d.%d", p[0], p[1], p[2], p[3]);
+ memset(&account, 0, sizeof(account));
+
if (ipban > 0) {
//ip ban
//p[0], p[1], p[2], p[3]
diff --git a/src/map/clif.c b/src/map/clif.c
index 20db97554..3761f52bf 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -10871,7 +10871,7 @@ static int packetdb_readdb(void)
char line[1024];
int ln=0;
int cmd,j,k,packet_ver;
- char *str[32],*p,*str2[32],*p2,w1[24],w2[24];
+ char *str[64],*p,*str2[64],*p2,w1[64],w2[64];
struct {
void (*func)(int, struct map_session_data *);
diff --git a/src/map/mail.c b/src/map/mail.c
index 46e80be9f..42a83de52 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -1,3 +1,4 @@
+#ifndef TXT_ONLY
// Mail System for eAthena SQL
// Created by Valaris
// moved all strings to msg_athena.conf [Lupus]
@@ -333,3 +334,4 @@ int do_init_mail(void)
return 0;
}
+#endif
diff --git a/src/map/skill.c b/src/map/skill.c
index b6010f151..0ea0c81fa 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -9394,6 +9394,7 @@ int skill_readdb(void)
printf("can't read db/skill_unit_db.txt\n");
return 1;
}
+ k = 0;
while (fgets(line,1020,fp)) {
char *split[50];
if (line[0]=='/' && line[1]=='/')