diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-18 01:59:26 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-18 01:59:26 +0000 |
commit | f37103daf4bab79d82330eda7e3128da1c7f5fc1 (patch) | |
tree | 6c4fed63b9834e6a3118ffefe03500c72f8915c1 /src/map/irc.c | |
parent | 6bad47558aa533c5ba589a4ac8e1dfde3028537e (diff) | |
download | hercules-f37103daf4bab79d82330eda7e3128da1c7f5fc1.tar.gz hercules-f37103daf4bab79d82330eda7e3128da1c7f5fc1.tar.bz2 hercules-f37103daf4bab79d82330eda7e3128da1c7f5fc1.tar.xz hercules-f37103daf4bab79d82330eda7e3128da1c7f5fc1.zip |
- Cleaned up irc.c (moved variable declarations before code commants >.>)
- Updated the VC project files by Joshuaali.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5316 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/irc.c')
-rw-r--r-- | src/map/irc.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/map/irc.c b/src/map/irc.c index 7f512963f..33e90669f 100644 --- a/src/map/irc.c +++ b/src/map/irc.c @@ -78,8 +78,9 @@ void irc_announce(char *buf) void irc_announce_jobchange(struct map_session_data *sd)
{
- nullpo_retv(sd);
char send_string[256];
+
+ nullpo_retv(sd);
memset(send_string,'\0',256);
sprintf(send_string,"PRIVMSG %s :%s has changed into a %s.",irc_channel,sd->status.name,job_name(sd->status.class_));
@@ -88,13 +89,13 @@ void irc_announce_jobchange(struct map_session_data *sd) void irc_announce_shop(struct map_session_data *sd, int flag)
{
- nullpo_retv(sd);
-
char send_string[256];
char mapname[16];
+ int maplen = 0;
+ nullpo_retv(sd);
+
memset(send_string,'\0',256);
memset(mapname,'\0',16);
- int maplen = 0;
if(flag){
strcpy(mapname, map[sd->bl.m].name);
@@ -111,16 +112,16 @@ void irc_announce_shop(struct map_session_data *sd, int flag) void irc_announce_mvp(struct map_session_data *sd, struct mob_data *md)
{
+ char send_string[256];
+ char mapname[16];
+ int maplen = 0;
+
nullpo_retv(sd);
nullpo_retv(md);
- char send_string[256];
- char mapname[16];
memset(send_string,'\0',256);
memset(mapname,'\0',16);
mapname[16]='\0';
- int maplen = 0;
-
strcpy(mapname, map[md->bl.m].name);
maplen = strcspn(mapname,".");
mapname[maplen] = '\0';
@@ -175,10 +176,11 @@ void irc_send_sub(int fd, char transmit[4096]) void irc_send(char *buf)
{
+ char transmit[4096];
+
if(!irc_si || !session[irc_si->fd])
return;
- char transmit[4096];
memset(transmit,'\0',4096);
sprintf(transmit,buf);
@@ -196,6 +198,7 @@ void irc_parse_sub(int fd, char *incoming_string) char *source_ident=NULL;
char *source_host=NULL;
char *state_mgr=NULL;
+
memset(source,'\0',256);
memset(command,'\0',256);
memset(target,'\0',256);
@@ -266,11 +269,12 @@ void do_final_irc(void) void do_init_irc(void)
{
+ struct hostent *irc_hostname;
+
if(!use_irc)
return;
if (irc_ip_str[strlen(irc_ip_str)-1] == '\n')
irc_ip_str[strlen(irc_ip_str)-1] = '\0';
- struct hostent *irc_hostname;
irc_hostname=gethostbyname(irc_ip_str);
irc_ip_str[0]='\0';
sprintf(irc_ip_str, "%d.%d.%d.%d", (unsigned char)irc_hostname->h_addr[0], (unsigned char)irc_hostname->h_addr[1],
|