summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-19 16:54:37 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-19 16:54:37 +0000
commitf4fb6137949da60fc8f2a5cde80a60a1f4760aa2 (patch)
tree5999ee9e328f90ebff236a978148a3e18d6e253c /src
parent08187eb49f9c0cde90ea84abac1135557559ae45 (diff)
downloadhercules-f4fb6137949da60fc8f2a5cde80a60a1f4760aa2.tar.gz
hercules-f4fb6137949da60fc8f2a5cde80a60a1f4760aa2.tar.bz2
hercules-f4fb6137949da60fc8f2a5cde80a60a1f4760aa2.tar.xz
hercules-f4fb6137949da60fc8f2a5cde80a60a1f4760aa2.zip
- Fixed parse_names on irc.c crashing when receiving a null argument.
- Modified the parsing of the names line, since some servers will send @ instead of = when separating the information. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7750 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/irc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/irc.c b/src/map/irc.c
index 4cfe1fc7c..9d59fba68 100644
--- a/src/map/irc.c
+++ b/src/map/irc.c
@@ -371,12 +371,12 @@ int parse_names_packet(char *str) {
memset(names,'\0',1024);
tok=strtok(str,"\r\n");
- sscanf(tok,":%255s %10s %255s = %255s :%1023[^\r\n]",source,numeric,target,channel,names);
+ sscanf(tok,":%255s %10s %255s %*1[=@] %255s :%1023[^\r\n]",source,numeric,target,channel,names);
if(strcmpi(numeric,"353")==0)
parse_names(names);
while((tok=strtok(NULL,"\r\n"))!=NULL) {
- sscanf(tok,":%255s %10s %255s = %255s :%1023[^\r\n]",source,numeric,target,channel,names);
+ sscanf(tok,":%255s %10s %255s %*1[=@] %255s :%1023[^\r\n]",source,numeric,target,channel,names);
if(strcmpi(numeric,"353")==0)
parse_names(names);
}
@@ -387,7 +387,7 @@ int parse_names_packet(char *str) {
//User access level prefix parser [Zido]
int parse_names(char *str) {
char *tok;
-
+ if (str == NULL) return 0; //Nothing to parse!
tok=strtok(str," ");
switch(tok[0]) {
case '~':
@@ -433,7 +433,7 @@ int parse_names(char *str) {
}
}
- return 0;
+ return 1;
}
//Store user's access level [Zido]