summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshinomori <shinomori@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-29 21:23:11 +0000
committershinomori <shinomori@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-29 21:23:11 +0000
commit3fa3357e7646c4f60bedd5cd343f6abcb1a3cb6e (patch)
treed4e9b1ba1f9ab079626769d76a2a8d1404201930 /src
parenta235b991dbd9ad76735f610d721c24af47f44c3e (diff)
downloadhercules-3fa3357e7646c4f60bedd5cd343f6abcb1a3cb6e.tar.gz
hercules-3fa3357e7646c4f60bedd5cd343f6abcb1a3cb6e.tar.bz2
hercules-3fa3357e7646c4f60bedd5cd343f6abcb1a3cb6e.tar.xz
hercules-3fa3357e7646c4f60bedd5cd343f6abcb1a3cb6e.zip
read_petdb() loop variable fix [Shinomori]
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1338 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/pet.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/map/pet.c b/src/map/pet.c
index 9df62c70e..87257f6be 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -1587,7 +1587,7 @@ int read_petdb()
{
FILE *fp;
char line[1024];
- int nameid,i;
+ int nameid,i,k;
int j=0;
int lines;
char *filename[]={"db/pet_db.txt","db/pet_db2.txt"};
@@ -1604,18 +1604,19 @@ int read_petdb()
}
lines = 0;
while(fgets(line,1020,fp)){
+
lines++;
if(line[0] == '/' && line[1] == '/')
continue;
- for(i=0,p=line;i<20;i++){
+ for(k=0,p=line;k<20;k++){
if((np=strchr(p,','))!=NULL){
- str[i]=p;
+ str[k]=p;
*np=0;
p=np+1;
} else {
- str[i]=p;
+ str[k]=p;
p+=strlen(p);
}
}