diff options
Diffstat (limited to 'src/char')
-rw-r--r-- | src/char/char.c | 17 | ||||
-rw-r--r-- | src/char/int_guild.c | 1 | ||||
-rw-r--r-- | src/char/int_homun.c | 1 | ||||
-rw-r--r-- | src/char/int_mail.c | 1 | ||||
-rw-r--r-- | src/char/inter.c | 2 | ||||
-rw-r--r-- | src/char/pincode.c | 3 |
6 files changed, 20 insertions, 5 deletions
diff --git a/src/char/char.c b/src/char/char.c index 5e3c34684..5f5dad539 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -850,6 +850,7 @@ int char_inventory_to_sql(const struct item items[], int max, int id) { bool found; int errors = 0; + nullpo_ret(items); // The following code compares inventory with current database values // and performs modification/deletion/insertion only on relevant rows. @@ -1479,6 +1480,7 @@ bool char_char_slotchange(struct char_session_data *sd, int fd, unsigned short f struct mmo_charstatus char_dat; int from_id = 0; + nullpo_ret(sd); if( from >= MAX_CHARS || to >= MAX_CHARS || ( sd->char_slots && to > sd->char_slots ) || sd->found_char[from] <= 0 ) return false; @@ -1649,6 +1651,8 @@ int char_make_new_char_sql(struct char_session_data* sd, char* name_, int str, i char esc_name[NAME_LENGTH*2+1]; int char_id, flag, k, l; + nullpo_retr(-2, sd); + nullpo_retr(-2, name_); safestrncpy(name, name_, NAME_LENGTH); normalize_name(name,TRIM_CHARS); SQL->EscapeStringLen(inter->sql_handle, esc_name, name, strnlen(name, NAME_LENGTH)); @@ -4256,6 +4260,7 @@ static void char_delete2_req(int fd, struct char_session_data* sd) time_t delete_date; char_id = RFIFOL(fd,2); + nullpo_retv(sd); ARR_FIND( 0, MAX_CHARS, i, sd->found_char[i] == char_id ); if( i == MAX_CHARS ) @@ -4327,6 +4332,7 @@ static void char_delete2_accept(int fd, struct char_session_data* sd) char* data; time_t delete_date; + nullpo_retv(sd); char_id = RFIFOL(fd,2); ShowInfo(CL_RED"Request Char Deletion: "CL_GREEN"%d (%d)"CL_RESET"\n", sd->account_id, char_id); @@ -4394,6 +4400,7 @@ static void char_delete2_cancel(int fd, struct char_session_data* sd) {// CH: <082b>.W <char id>.L int char_id, i; + nullpo_retv(sd); char_id = RFIFOL(fd,2); ARR_FIND( 0, MAX_CHARS, i, sd->found_char[i] == char_id ); @@ -4542,6 +4549,7 @@ int char_search_default_maps_mapserver(struct mmo_charstatus *cd) return i; } +void char_parse_char_select(int fd, struct char_session_data* sd, uint32 ipl) __attribute__((nonnull (2))); void char_parse_char_select(int fd, struct char_session_data* sd, uint32 ipl) { struct mmo_charstatus char_dat; @@ -4706,6 +4714,7 @@ void char_creation_ok(int fd, struct mmo_charstatus *char_dat) WFIFOSET(fd,len); } +void char_parse_char_create_new_char(int fd, struct char_session_data* sd) __attribute__((nonnull (2))); void char_parse_char_create_new_char(int fd, struct char_session_data* sd) { int result; @@ -4756,6 +4765,7 @@ void char_delete_char_ok(int fd) WFIFOSET(fd,2); } +void char_parse_char_delete_char(int fd, struct char_session_data* sd, unsigned short cmd) __attribute__((nonnull (2))); void char_parse_char_delete_char(int fd, struct char_session_data* sd, unsigned short cmd) { char email[40]; @@ -4823,6 +4833,7 @@ void char_allow_rename(int fd, int flag) WFIFOSET(fd,4); } +void char_parse_char_rename_char(int fd, struct char_session_data* sd) __attribute__((nonnull (2))); void char_parse_char_rename_char(int fd, struct char_session_data* sd) { int i, cid =RFIFOL(fd,2); @@ -4847,6 +4858,7 @@ void char_parse_char_rename_char(int fd, struct char_session_data* sd) chr->allow_rename(fd, i); } +void char_parse_char_rename_char2(int fd, struct char_session_data* sd) __attribute__((nonnull (2))); void char_parse_char_rename_char2(int fd, struct char_session_data* sd) { int i, aid = RFIFOL(fd,2), cid =RFIFOL(fd,6); @@ -4882,6 +4894,7 @@ void char_rename_char_ack(int fd, int flag) WFIFOSET(fd,4); } +void char_parse_char_rename_char_confirm(int fd, struct char_session_data* sd) __attribute__((nonnull (2))); void char_parse_char_rename_char_confirm(int fd, struct char_session_data* sd) { int i; @@ -4977,6 +4990,7 @@ void char_parse_char_login_map_server(int fd) RFIFOSKIP(fd,60); } +void char_parse_char_pincode_check(int fd, struct char_session_data* sd) __attribute__((nonnull (2))); void char_parse_char_pincode_check(int fd, struct char_session_data* sd) { if (RFIFOL(fd,2) == sd->account_id) @@ -4985,6 +4999,7 @@ void char_parse_char_pincode_check(int fd, struct char_session_data* sd) RFIFOSKIP(fd, 10); } +void char_parse_char_pincode_window(int fd, struct char_session_data* sd) __attribute__((nonnull (2))); void char_parse_char_pincode_window(int fd, struct char_session_data* sd) { if (RFIFOL(fd,2) == sd->account_id) @@ -4993,6 +5008,7 @@ void char_parse_char_pincode_window(int fd, struct char_session_data* sd) RFIFOSKIP(fd, 6); } +void char_parse_char_pincode_change(int fd, struct char_session_data* sd) __attribute__((nonnull (2))); void char_parse_char_pincode_change(int fd, struct char_session_data* sd) { if (RFIFOL(fd,2) == sd->account_id) @@ -5001,6 +5017,7 @@ void char_parse_char_pincode_change(int fd, struct char_session_data* sd) RFIFOSKIP(fd, 14); } +void char_parse_char_pincode_first_pin(int fd, struct char_session_data* sd) __attribute__((nonnull (2))); void char_parse_char_pincode_first_pin(int fd, struct char_session_data* sd) { if (RFIFOL(fd,2) == sd->account_id) diff --git a/src/char/int_guild.c b/src/char/int_guild.c index 96a78203f..24561fe21 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -882,7 +882,6 @@ int inter_guild_calcinfo(struct guild *g) int mapif_guild_created(int fd, int account_id, struct guild *g) { - nullpo_ret(g); WFIFOHEAD(fd, 10); WFIFOW(fd,0)=0x3830; WFIFOL(fd,2)=account_id; diff --git a/src/char/int_homun.c b/src/char/int_homun.c index 2ec589eaf..eda2afe69 100644 --- a/src/char/int_homun.c +++ b/src/char/int_homun.c @@ -54,7 +54,6 @@ void mapif_homunculus_deleted(int fd, int flag) void mapif_homunculus_loaded(int fd, int account_id, struct s_homunculus *hd) { - nullpo_retv(hd); WFIFOHEAD(fd, sizeof(struct s_homunculus)+9); WFIFOW(fd,0) = 0x3891; WFIFOW(fd,2) = sizeof(struct s_homunculus)+9; diff --git a/src/char/int_mail.c b/src/char/int_mail.c index 0d46339e0..d4bfe14e4 100644 --- a/src/char/int_mail.c +++ b/src/char/int_mail.c @@ -459,7 +459,6 @@ void inter_mail_sendmail(int send_id, const char* send_name, int dest_id, const nullpo_retv(dest_name); nullpo_retv(title); nullpo_retv(body); - nullpo_retv(item); memset(&msg, 0, sizeof(struct mail_message)); msg.send_id = send_id; diff --git a/src/char/inter.c b/src/char/inter.c index ca041d581..dbb782093 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -503,7 +503,7 @@ void mapif_parse_accinfo2(bool success, int map_fd, int u_fd, int u_aid, int acc inter->msg_to_fd(map_fd, u_fd, u_aid, "-- Account %d --", account_id); inter->msg_to_fd(map_fd, u_fd, u_aid, "User: %s | GM Group: %d | State: %d", userid, group_id, state); - if (user_pass && *user_pass != '\0') { /* password is only received if your gm level is greater than the one you're searching for */ + if (*user_pass != '\0') { /* password is only received if your gm level is greater than the one you're searching for */ if (pin_code && *pin_code != '\0') inter->msg_to_fd(map_fd, u_fd, u_aid, "Password: %s (PIN:%s)", user_pass, pin_code); else diff --git a/src/char/pincode.c b/src/char/pincode.c index 43958af8a..5085349cc 100644 --- a/src/char/pincode.c +++ b/src/char/pincode.c @@ -21,9 +21,10 @@ struct pincode_interface pincode_s; void pincode_handle (int fd, struct char_session_data* sd) { - struct online_char_data* character = (struct online_char_data*)idb_get(chr->online_char_db, sd->account_id); + struct online_char_data* character; nullpo_retv(sd); + character = (struct online_char_data*)idb_get(chr->online_char_db, sd->account_id); if( character && character->pincode_enable > pincode->charselect ){ character->pincode_enable = pincode->charselect * 2; }else{ |