summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-08-22 20:33:06 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-08-22 20:33:06 +0000
commit082687fc204c7b40bf676ad710c2488048571b73 (patch)
tree59b356c4d4cc86122ef42c46d9500ddeb93ba6bc /src/char
parenta31d779891778d76d1c0fac3544e6dd1627da98a (diff)
downloadhercules-082687fc204c7b40bf676ad710c2488048571b73.tar.gz
hercules-082687fc204c7b40bf676ad710c2488048571b73.tar.bz2
hercules-082687fc204c7b40bf676ad710c2488048571b73.tar.xz
hercules-082687fc204c7b40bf676ad710c2488048571b73.zip
Major cleanup all over the place, made possible by mkbu95's scan-build report he provided us with.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16687 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char')
-rw-r--r--src/char/char.c11
-rw-r--r--src/char/inter.c5
2 files changed, 6 insertions, 10 deletions
diff --git a/src/char/char.c b/src/char/char.c
index e37aacf51..0471c91d6 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -3413,7 +3413,7 @@ void char_delete2_cancel_ack(int fd, int char_id, uint32 result)
static void char_delete2_req(int fd, struct char_session_data* sd)
{// CH: <0827>.W <char id>.L
- int char_id, i, guild_id, party_id;
+ int char_id, i;
char* data;
time_t delete_date;
@@ -3426,19 +3426,16 @@ static void char_delete2_req(int fd, struct char_session_data* sd)
return;
}
- if( SQL_SUCCESS != Sql_Query(sql_handle, "SELECT `guild_id`,`party_id`,`delete_date` FROM `%s` WHERE `char_id`='%d'", char_db, char_id) || SQL_SUCCESS != Sql_NextRow(sql_handle) )
+ if( SQL_SUCCESS != Sql_Query(sql_handle, "SELECT `delete_date` FROM `%s` WHERE `char_id`='%d'", char_db, char_id) || SQL_SUCCESS != Sql_NextRow(sql_handle) )
{
Sql_ShowDebug(sql_handle);
char_delete2_ack(fd, char_id, 3, 0);
return;
}
- Sql_GetData(sql_handle, 0, &data, NULL); guild_id = atoi(data);
- Sql_GetData(sql_handle, 1, &data, NULL); party_id = atoi(data);
- Sql_GetData(sql_handle, 2, &data, NULL); delete_date = strtoul(data, NULL, 10);
+ Sql_GetData(sql_handle, 0, &data, NULL); delete_date = strtoul(data, NULL, 10);
- if( delete_date )
- {// character already queued for deletion
+ if( delete_date ) {// character already queued for deletion
char_delete2_ack(fd, char_id, 0, 0);
return;
}
diff --git a/src/char/inter.c b/src/char/inter.c
index 80dc9372c..2b7872eb9 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -378,11 +378,10 @@ const char * geoip_countryname[253] = {"Unknown","Asia/Pacific Region","Europe",
unsigned char *geoip_cache;
void geoip_readdb(void){
struct stat bufa;
- size_t fileReadCount;
FILE *db=fopen("./db/GeoIP.dat","r");
fstat(fileno(db), &bufa);
geoip_cache = (unsigned char *) malloc(sizeof(unsigned char) * bufa.st_size);
- fileReadCount = fread(geoip_cache, sizeof(unsigned char), bufa.st_size, db);
+ (void)fread(geoip_cache, sizeof(unsigned char), bufa.st_size, db);
fclose(db);
ShowStatus("Finished Reading "CL_GREEN"GeoIP"CL_RESET" Database.\n");
}
@@ -392,7 +391,7 @@ const char* geoip_getcountry(uint32 ipnum){
int depth;
unsigned int x;
unsigned char stack_buffer[6];
- const unsigned char *buf = stack_buffer;
+ const unsigned char *buf;
unsigned int offset = 0;
for (depth = 31; depth >= 0; depth--) {