summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-30 14:57:12 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-30 14:57:12 +0000
commit5d2d03817a6db5c1df979aa38941d76d9abed64a (patch)
tree8247690d173915920435624babc59cd0ef9207f9 /src
parent345763fe7f6c48f4e79a65c9dafb7fea9b1c6224 (diff)
downloadhercules-5d2d03817a6db5c1df979aa38941d76d9abed64a.tar.gz
hercules-5d2d03817a6db5c1df979aa38941d76d9abed64a.tar.bz2
hercules-5d2d03817a6db5c1df979aa38941d76d9abed64a.tar.xz
hercules-5d2d03817a6db5c1df979aa38941d76d9abed64a.zip
* Cleaned up mistakes in irc.c
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5810 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/irc.c20
-rw-r--r--src/mysql/my_global.h2
2 files changed, 8 insertions, 14 deletions
diff --git a/src/map/irc.c b/src/map/irc.c
index c61c5d890..0104fcfb7 100644
--- a/src/map/irc.c
+++ b/src/map/irc.c
@@ -203,7 +203,7 @@ void irc_parse_sub(int fd, char *incoming_string)
char *source_nick=NULL;
char *source_ident=NULL;
char *source_host=NULL;
-// char *state_mgr=NULL;
+ char *state_mgr=NULL;
memset(source,'\0',256);
memset(command,'\0',256);
@@ -214,10 +214,9 @@ void irc_parse_sub(int fd, char *incoming_string)
sscanf(incoming_string, ":%255s %255s %255s :%4095[^\n]", source, command, target, message);
if (source != NULL) {
if (strstr(source,"!") != NULL) {
- sscanf(source,"%s!%s@%s",source_nick, source_ident, source_host);
- //source_nick = strtok_r(source,"!",&state_mgr);
- //source_ident = strtok_r(NULL,"@",&state_mgr);
- //source_host = strtok_r(NULL,"%%",&state_mgr);
+ source_nick = strtok_r(source,"!",&state_mgr);
+ source_ident = strtok_r(NULL,"@",&state_mgr);
+ source_host = strtok_r(NULL,"%%",&state_mgr);
}
}
if (irc_si->state == 0){
@@ -256,20 +255,15 @@ void irc_parse_sub(int fd, char *incoming_string)
int send_to_parser(int fd, char *input,char key[2])
{
- char format[4];
char *temp_string=NULL;
- char *next_string=NULL;
-// char *state_mgr=NULL;
+ char *state_mgr=NULL;
int total_loops=0;
- //temp_string = strtok_r(input,key,&state_mgr);
- sprintf(format,"%s%s%s","%s",key,"%s");
- sscanf(input, format, temp_string, next_string);
+ temp_string = strtok_r(input,key,&state_mgr);
while (temp_string != NULL){
total_loops = total_loops+1;
irc_parse_sub(fd,temp_string);
- //temp_string = strtok_r(NULL,key,&state_mgr);
- sscanf(next_string, format, temp_string, next_string);
+ temp_string = strtok_r(NULL,key,&state_mgr);
}
return total_loops;
}
diff --git a/src/mysql/my_global.h b/src/mysql/my_global.h
index af723424d..6c3937467 100644
--- a/src/mysql/my_global.h
+++ b/src/mysql/my_global.h
@@ -658,7 +658,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define SET_STACK_SIZE(X) /* Not needed on real machines */
#if !defined(HAVE_mit_thread) && !defined(HAVE_STRTOK_R)
-#define strtok_r(A,B,C) strtok((A),(B))
+#include "../common/strlib.h"
#endif
/* Remove some things that mit_thread break or doesn't support */