From 0dedb26f02c0168007343a16f9f32b8416bcb7f4 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Fri, 9 Dec 2016 10:31:17 -0500 Subject: [PATCH] resolve various issues from static analyzer run --- include/acm.h | 2 +- include/scoring.h | 4 ++-- src/freespace2/freespace.cpp | 12 ++++++------ src/hud/hudtarget.cpp | 2 +- src/mission/missionbriefcommon.cpp | 24 ------------------------ src/mission/missionmessage.cpp | 2 +- src/mission/missiontraining.cpp | 2 +- src/network/multi_campaign.cpp | 3 +-- src/network/multi_kick.cpp | 1 + src/network/multi_options.cpp | 6 +++++- src/network/multiui.cpp | 3 ++- src/network/multiutil.cpp | 6 ++++-- src/network/psnet.cpp | 3 --- src/object/collideshipship.cpp | 18 ++++++++++-------- src/object/object.cpp | 2 +- src/object/objectsnd.cpp | 6 ++---- src/palman/palman.cpp | 2 ++ src/physics/physics.cpp | 16 ++++++++-------- src/ship/aicode.cpp | 2 +- src/ship/ship.cpp | 4 ++++ src/sound/acm.cpp | 6 +----- src/sound/oal.cpp | 2 +- src/vcodec/codec1.cpp | 3 +-- src/weapon/weapons.cpp | 2 +- 24 files changed, 57 insertions(+), 76 deletions(-) diff --git a/include/acm.h b/include/acm.h index 370a0c9..8ad5dd5 100644 --- a/include/acm.h +++ b/include/acm.h @@ -53,7 +53,7 @@ #include "pstypes.h" #include "oal.h" -int ACM_convert_ADPCM_to_PCM(WAVE_chunk *pwfxSrc, ubyte *src, int src_len, ubyte **dest, int max_dest_bytes, int *dest_len, unsigned int *src_bytes_used, unsigned short dest_bps=16); +int ACM_convert_ADPCM_to_PCM(WAVE_chunk *pwfxSrc, ubyte *src, int src_len, ubyte **dest, int *dest_len, unsigned int *src_bytes_used, unsigned short dest_bps=16); int ACM_stream_open(WAVE_chunk *pwfxSrc, WAVE_chunk *pwfxDest, void **stream, int dest_bps=16); int ACM_stream_close(void *stream); diff --git a/include/scoring.h b/include/scoring.h index 6f713f1..7bef113 100644 --- a/include/scoring.h +++ b/include/scoring.h @@ -194,10 +194,10 @@ struct player; // ARGH. IMPORTANT : do not change NUM_MEDALS without talking to DaveB first. It will affect the size of the scoring struct and hence, will break // a lot of PXO related stuff. SEE ALSO : MAX_SHIP_TYPES -#ifdef FS2_DEMO +#if defined(FS2_DEMO) #define NUM_MEDALS 16 #define NUM_MEDALS_FS1 16 -#elif MAKE_FS1 +#elif defined(MAKE_FS1) #define NUM_MEDALS 16 #define NUM_MEDALS_FS1 16 #else diff --git a/src/freespace2/freespace.cpp b/src/freespace2/freespace.cpp index e5ead50..a46774f 100644 --- a/src/freespace2/freespace.cpp +++ b/src/freespace2/freespace.cpp @@ -7922,15 +7922,15 @@ int detect_lang() #define NUM_SHIPS_TBL_CHECKSUMS 1 #endif -#ifdef FS2_DEMO +#if defined(FS2_DEMO) int Game_ships_tbl_checksums[NUM_SHIPS_TBL_CHECKSUMS] = { 1696074201, // FS2 demo }; -#elif FS1_DEMO +#elif defined(FS1_DEMO) int Game_ships_tbl_checksums[NUM_SHIPS_TBL_CHECKSUMS] = { 1603375034, // FS1 DEMO }; -#elif MAKE_FS1 +#elif defined(MAKE_FS1) int Game_ships_tbl_checksums[NUM_SHIPS_TBL_CHECKSUMS] = { -129679197, // FS1 Full 1.06 (US) 7762567, // FS1 SilentThreat @@ -8010,15 +8010,15 @@ DCF(shipspew, "display the checksum for the current ships.tbl") #define NUM_WEAPONS_TBL_CHECKSUMS 1 #endif -#ifdef FS2_DEMO +#if defined(FS2_DEMO) int Game_weapons_tbl_checksums[NUM_WEAPONS_TBL_CHECKSUMS] = { -266420030, // demo 1 }; -#elif FS1_DEMO +#elif defined(FS1_DEMO) int Game_weapons_tbl_checksums[NUM_WEAPONS_TBL_CHECKSUMS] = { -1246928725, // FS1 DEMO }; -#elif MAKE_FS1 +#elif defined(MAKE_FS1) int Game_weapons_tbl_checksums[NUM_WEAPONS_TBL_CHECKSUMS] = { -834598107, // FS1 1.06 Full (US) -1652231417, // FS1 SilentThreat diff --git a/src/hud/hudtarget.cpp b/src/hud/hudtarget.cpp index 27f6368..c6429a3 100644 --- a/src/hud/hudtarget.cpp +++ b/src/hud/hudtarget.cpp @@ -882,7 +882,7 @@ object *hud_reticle_pick_target() } } - for ( cur_rl = GET_FIRST(&Reticle_cur_list); cur_rl != END_OF_LIST(&Reticle_cur_list); cur_rl = GET_NEXT(cur_rl) ) { + for ( cur_rl = GET_FIRST(&Reticle_cur_list); cur_rl && (cur_rl != END_OF_LIST(&Reticle_cur_list)); cur_rl = GET_NEXT(cur_rl) ) { in_save_list = 0; for ( save_rl = GET_FIRST(&Reticle_save_list); save_rl != END_OF_LIST(&Reticle_save_list); save_rl = GET_NEXT(save_rl) ) { if ( cur_rl->objp == save_rl->objp ) { diff --git a/src/mission/missionbriefcommon.cpp b/src/mission/missionbriefcommon.cpp index cdd20a4..3643367 100644 --- a/src/mission/missionbriefcommon.cpp +++ b/src/mission/missionbriefcommon.cpp @@ -951,10 +951,6 @@ void brief_preload_highlight_anim(brief_icon *bi) hud_anim *ha; int species = ship_get_species_by_type(bi->ship_class); -#ifdef MAKE_FS1 - species = 0; -#endif - if(species < 0){ return; } @@ -981,10 +977,6 @@ void brief_preload_fade_anim(brief_icon *bi) hud_anim *ha; int species = ship_get_species_by_type(bi->ship_class); -#ifdef MAKE_FS1 - species = 0; -#endif - if(species < 0){ return; } @@ -1234,10 +1226,6 @@ void brief_render_icon(int stage_num, int icon_num, float frametime, int selecte int species = ship_get_species_by_type(bi->ship_class); -#ifdef MAKE_FS1 - species = 0; -#endif - if(species < 0){ return; } @@ -2067,10 +2055,6 @@ int brief_set_move_list(int new_stage, int current_stage, float time) int species = ship_get_species_by_type(cb->icons[i].ship_class); -#ifdef MAKE_FS1 - species = 0; -#endif - if(species < 0) { return 0; } @@ -2094,10 +2078,6 @@ int brief_set_move_list(int new_stage, int current_stage, float time) if ( is_new ) { int species = ship_get_species_by_type(newb->icons[i].ship_class); -#ifdef MAKE_FS1 - species = 0; -#endif - if(species < 0) { return 0; } @@ -2726,10 +2706,6 @@ void brief_common_get_icon_dimensions(int *w, int *h, int type, int ship_class) int species = ship_get_species_by_type(ship_class); -#ifdef MAKE_FS1 - species = 0; -#endif - if(species < 0){ return; } diff --git a/src/mission/missionmessage.cpp b/src/mission/missionmessage.cpp index fb5c9a0..c4b434e 100644 --- a/src/mission/missionmessage.cpp +++ b/src/mission/missionmessage.cpp @@ -1955,7 +1955,7 @@ void message_send_builtin_to_player( int type, ship *shipp, int priority, int ti if ( !(Game_mode & GM_MULTIPLAYER) || ((multi_target == -1) || (multi_target == MY_NET_PLAYER_NUM)) ){ // if this filter matches mine - if( (multi_team_filter < 0) || !(Netgame.type_flags & NG_TYPE_TEAM) || ((Net_player != NULL) && (Net_player->p_info.team == multi_team_filter)) ){ + if( (multi_team_filter < 0) || !(Netgame.type_flags & NG_TYPE_TEAM) || (Net_player->p_info.team == multi_team_filter) ){ message_queue_message( i, priority, timing, who_from, source, group, delay, type ); // post a builtin message diff --git a/src/mission/missiontraining.cpp b/src/mission/missiontraining.cpp index a6c45f3..5a37dd4 100644 --- a/src/mission/missiontraining.cpp +++ b/src/mission/missiontraining.cpp @@ -851,7 +851,7 @@ void message_translate_tokens(char *buf, const int max_buflen, char *text) text = toke2 + 1; // advance pointers past processed data toke1 = SDL_strchr(text, '#'); - if (toke1) // No second one? + if (!toke1) // No second one? break; len = SDL_min(toke1 - text + 1, max_buflen); diff --git a/src/network/multi_campaign.cpp b/src/network/multi_campaign.cpp index 18bc326..98d8c82 100644 --- a/src/network/multi_campaign.cpp +++ b/src/network/multi_campaign.cpp @@ -687,10 +687,9 @@ void multi_campaign_send_start(net_player *pl) void multi_campaign_send_ingame_start( net_player *pl ) { ubyte data[MAX_PACKET_SIZE], packet_type, num_goals, num_events, *ptr; - int packet_size, i, j; + int packet_size = 0, i, j; SDL_assert( pl != NULL ); - packet_size = 0; if ( Game_mode & GM_CAMPAIGN_MODE ) { diff --git a/src/network/multi_kick.cpp b/src/network/multi_kick.cpp index de78f51..0ab4216 100644 --- a/src/network/multi_kick.cpp +++ b/src/network/multi_kick.cpp @@ -278,6 +278,7 @@ void multi_kick_get_text(net_player *pl, int reason, char *str, const int max_st // safety net if((pl == NULL) || (pl->player == NULL)){ SDL_strlcpy(str, NOX(""), max_strlen); + return; } switch(reason){ diff --git a/src/network/multi_options.cpp b/src/network/multi_options.cpp index 09840c0..3823b6b 100644 --- a/src/network/multi_options.cpp +++ b/src/network/multi_options.cpp @@ -365,6 +365,10 @@ void multi_options_read_config() } } + if (tok == NULL) { + continue; + } + // common to all modes if(SETTING("+user_server")){ // ip addr of user tracker @@ -423,7 +427,7 @@ void multi_options_read_config() Multi_options_g.datarate_cap = atoi(tok); } } - } + } else if(SETTING("+http_proxy")){ // get the proxy server NEXT_TOKEN(); diff --git a/src/network/multiui.cpp b/src/network/multiui.cpp index 498214d..62a3623 100644 --- a/src/network/multiui.cpp +++ b/src/network/multiui.cpp @@ -3494,6 +3494,7 @@ void multi_sg_rank_build_name(char *in, char *out, const int max_outlen) // just copy the string if(first == NULL){ SDL_strlcpy(out, in, max_outlen); + return; } // if the first part of the string is lieutenant, then abbreivate it and tack on the rest of the string @@ -8251,7 +8252,7 @@ void multi_sync_blit_screen_all() state = Net_players[idx].state; // if we're ingame joining, show all other players except myself as "playing" - if((Net_player != NULL) && (&Net_players[idx] != Net_player) && ((Multi_sync_mode == MULTI_SYNC_INGAME) || (Net_player->flags & NETINFO_FLAG_INGAME_JOIN)) ){ + if((&Net_players[idx] != Net_player) && ((Multi_sync_mode == MULTI_SYNC_INGAME) || (Net_player->flags & NETINFO_FLAG_INGAME_JOIN)) ){ state = NETPLAYER_STATE_IN_MISSION; } diff --git a/src/network/multiutil.cpp b/src/network/multiutil.cpp index a492b06..272aa79 100644 --- a/src/network/multiutil.cpp +++ b/src/network/multiutil.cpp @@ -1053,7 +1053,7 @@ void delete_player(int player_num,int kicked_reason) Net_players[player_num].flags &= ~(NETINFO_FLAG_GAME_HOST); // am I the server - if((Net_player != NULL) && (Net_player->flags & NETINFO_FLAG_AM_MASTER)){ + if(Net_player->flags & NETINFO_FLAG_AM_MASTER){ // are we a standalone server and in a mission? if((Game_mode & GM_STANDALONE_SERVER) && MULTI_IN_MISSION){ // choose a new host @@ -2280,8 +2280,10 @@ void multi_warpout_all_players() return; } + SDL_assert(Player_obj != NULL); + // stop my afterburners - if((Player_obj != NULL) && (Player_obj->type == OBJ_SHIP) && !(Game_mode & GM_STANDALONE_SERVER)){ + if((Player_obj->type == OBJ_SHIP) && !(Game_mode & GM_STANDALONE_SERVER)){ afterburners_stop( Player_obj, 1 ); } diff --git a/src/network/psnet.cpp b/src/network/psnet.cpp index f73c041..a933e4a 100644 --- a/src/network/psnet.cpp +++ b/src/network/psnet.cpp @@ -2542,7 +2542,6 @@ int psnet_reliable_send(ubyte *data,int packet_size,net_addr_t *addr) } // try and find a guy to send to - to_index = -1; to_index = psnet_reliable_addr_index(addr); if(to_index == -1){ nprintf(("Network","PSNET RELIABLE : could not find player for outgoing packet!\n")); @@ -2550,7 +2549,6 @@ int psnet_reliable_send(ubyte *data,int packet_size,net_addr_t *addr) } // attempt to get a free buffer - free_buffer = -1; free_buffer = psnet_reliable_get_free_outgoing(); if(free_buffer == -1){ Int3(); // should never happen - we should always overwrite the oldest buffer @@ -2671,7 +2669,6 @@ int psnet_reliable_should_process(net_addr_t *addr,ubyte *data,int packet_size) packet_index = psnet_reliable_find_in_id(id_num); if(packet_index == -1){ // get a free index - free_index = -1; free_index = psnet_reliable_get_free_incoming(); if(free_index == -1){ Int3(); diff --git a/src/object/collideshipship.cpp b/src/object/collideshipship.cpp index 3addbf4..a72972d 100644 --- a/src/object/collideshipship.cpp +++ b/src/object/collideshipship.cpp @@ -1182,24 +1182,26 @@ void calculate_ship_ship_collision_physics(collision_info_struct *ship_ship_hit_ bool set_model = false; polymodel *pm = model_get(Ships[heavy->instance].modelnum); + bsp_info *sm = &pm->submodel[ship_ship_hit_info->submodel_num]; // be sure model is set - if (pm->submodel[ship_ship_hit_info->submodel_num].sii == NULL) { + if (sm->sii == NULL) { set_model = true; ship_model_start(heavy); + SDL_assert(sm->sii != NULL); } // set point on axis of rotating submodel if not already set. - if (!pm->submodel[ship_ship_hit_info->submodel_num].sii->axis_set) { - model_init_submodel_axis_pt(pm->submodel[ship_ship_hit_info->submodel_num].sii, Ships[heavy->instance].modelnum, ship_ship_hit_info->submodel_num); + if (!sm->sii->axis_set) { + model_init_submodel_axis_pt(sm->sii, Ships[heavy->instance].modelnum, ship_ship_hit_info->submodel_num); } vector omega, axis, r_rot; - if (pm->submodel[ship_ship_hit_info->submodel_num].movement_axis == MOVEMENT_AXIS_X) { + if (sm->movement_axis == MOVEMENT_AXIS_X) { axis = vmd_x_vector; - } else if (pm->submodel[ship_ship_hit_info->submodel_num].movement_axis == MOVEMENT_AXIS_Y) { + } else if (sm->movement_axis == MOVEMENT_AXIS_Y) { axis = vmd_y_vector; - } else if (pm->submodel[ship_ship_hit_info->submodel_num].movement_axis == MOVEMENT_AXIS_Z) { + } else if (sm->movement_axis == MOVEMENT_AXIS_Z) { axis = vmd_z_vector; } else { // must be one of these axes or submodel_rot_hit is incorrectly set @@ -1208,11 +1210,11 @@ void calculate_ship_ship_collision_physics(collision_info_struct *ship_ship_hit_ // get world rotational velocity of rotating submodel model_find_obj_dir(&omega, &axis, heavy, ship_ship_hit_info->submodel_num); - vm_vec_scale(&omega, pm->submodel[ship_ship_hit_info->submodel_num].sii->cur_turn_rate); + vm_vec_scale(&omega, sm->sii->cur_turn_rate); // world coords for r_rot vector temp; - vm_vec_unrotate(&temp, &pm->submodel[ship_ship_hit_info->submodel_num].sii->pt_on_axis, &heavy->orient); + vm_vec_unrotate(&temp, &sm->sii->pt_on_axis, &heavy->orient); vm_vec_sub(&r_rot, &ship_ship_hit_info->hit_pos, &temp); // vm_vec_rotate(&temp, &r_rot, &heavy->orient); // to ship coords diff --git a/src/object/object.cpp b/src/object/object.cpp index edf50cb..697069d 100644 --- a/src/object/object.cpp +++ b/src/object/object.cpp @@ -508,7 +508,7 @@ const char *Object_type_names[MAX_OBJECT_TYPES] = { int free_object_slots(int num_used) { int i, olind, deleted_weapons; - int obj_list[MAX_OBJECTS]; + int obj_list[MAX_OBJECTS] = { 0 }; int num_already_free, num_to_free, original_num_to_free; object *objp; diff --git a/src/object/objectsnd.cpp b/src/object/objectsnd.cpp index a57882d..ebc9b24 100644 --- a/src/object/objectsnd.cpp +++ b/src/object/objectsnd.cpp @@ -518,10 +518,8 @@ void obj_snd_stop_all() { object* A; - for ( A = GET_FIRST(&obj_used_list); A !=END_OF_LIST(&obj_used_list); A = GET_NEXT(A) ) { - if ( A ) { - obj_snd_stop(A, -1); - } + for ( A = GET_FIRST(&obj_used_list); A && A !=END_OF_LIST(&obj_used_list); A = GET_NEXT(A) ) { + obj_snd_stop(A, -1); } } diff --git a/src/palman/palman.cpp b/src/palman/palman.cpp index d9bfad7..57d2df5 100644 --- a/src/palman/palman.cpp +++ b/src/palman/palman.cpp @@ -651,6 +651,7 @@ void palman_create_blend_table(float factor, ubyte *table) Df = 1.0f - si; } } else { + /* if ( si > 1.0f ) { Sf = 1.0f; Df = 0.0f; @@ -658,6 +659,7 @@ void palman_create_blend_table(float factor, ubyte *table) Sf = si; Df = 1.0f; } + */ Sf = factor; Df = 1.0f; } diff --git a/src/physics/physics.cpp b/src/physics/physics.cpp index 3161e62..9f23656 100644 --- a/src/physics/physics.cpp +++ b/src/physics/physics.cpp @@ -812,16 +812,16 @@ void physics_predict_vel(physics_info *pi, float delta_time, vector *predicted_v { if (pi->flags & PF_CONST_VEL) { predicted_vel = &pi->vel; - } else { - apply_physics( pi->side_slip_time_const, pi->desired_vel.xyz.x, pi->vel.xyz.x, delta_time, - &predicted_vel->xyz.x, NULL ); + } - apply_physics( pi->side_slip_time_const, pi->desired_vel.xyz.y, pi->vel.xyz.y, delta_time, - &predicted_vel->xyz.y, NULL ); + apply_physics( pi->side_slip_time_const, pi->desired_vel.xyz.x, pi->vel.xyz.x, delta_time, + &predicted_vel->xyz.x, NULL ); - apply_physics( pi->side_slip_time_const, pi->desired_vel.xyz.z, pi->vel.xyz.z, delta_time, - &predicted_vel->xyz.z, NULL ); - } + apply_physics( pi->side_slip_time_const, pi->desired_vel.xyz.y, pi->vel.xyz.y, delta_time, + &predicted_vel->xyz.y, NULL ); + + apply_physics( pi->side_slip_time_const, pi->desired_vel.xyz.z, pi->vel.xyz.z, delta_time, + &predicted_vel->xyz.z, NULL ); } // function to predict position and velocity of an object diff --git a/src/ship/aicode.cpp b/src/ship/aicode.cpp index 38775d3..32c0925 100644 --- a/src/ship/aicode.cpp +++ b/src/ship/aicode.cpp @@ -3106,7 +3106,7 @@ void ai_attack_object(object *attacker, object *attacked, int priority, ship_sub if (!(Ship_info[Ships[attacker->instance].ship_info_index].flags & SIF_SMALL_SHIP)) { // nprintf(("AI","Note: AI ship %s refusing to set AI mode to AIM_CHASE\n", Ships[attacker->instance].ship_name)); // return; - nprintf(("AI", "AI ship %s is large ship ordered to attack %s\n", Ships[attacker->instance].ship_name, Ships[attacked->instance].ship_name)); + nprintf(("AI", "AI ship %s is large ship ordered to attack %s\n", Ships[attacker->instance].ship_name, (attacked) ? Ships[attacked->instance].ship_name : "")); } // This is how "engage enemy" gets processed diff --git a/src/ship/ship.cpp b/src/ship/ship.cpp index 52af66f..27eb93a 100644 --- a/src/ship/ship.cpp +++ b/src/ship/ship.cpp @@ -9515,6 +9515,10 @@ int ship_is_beginning_warpout_speedup(object *objp) // given a ship info type, return a species int ship_get_species_by_type(int ship_info_index) { +#ifdef MAKE_FS1 + return 0; +#endif + // sanity if((ship_info_index < 0) || (ship_info_index >= Num_ship_types)){ return -1; diff --git a/src/sound/acm.cpp b/src/sound/acm.cpp index 380cca9..1ed8542 100644 --- a/src/sound/acm.cpp +++ b/src/sound/acm.cpp @@ -298,7 +298,7 @@ static void adpcm_memory_free(adpcm_fmt_t *fmt) // 1. Storage for the decompressed audio will be allocated in this function if *dest in NULL. // The caller is responsible for freeing this memory later. // -int ACM_convert_ADPCM_to_PCM(WAVE_chunk *pwfxSrc, ubyte *src, int src_len, ubyte **dest, int max_dest_bytes, int *dest_len, unsigned int *src_bytes_used, unsigned short dest_bps) +int ACM_convert_ADPCM_to_PCM(WAVE_chunk *pwfxSrc, ubyte *src, int src_len, ubyte **dest, int *dest_len, unsigned int *src_bytes_used, unsigned short dest_bps) { SDL_assert( pwfxSrc != NULL ); SDL_assert( pwfxSrc->code == WAVE_FORMAT_ADPCM ); @@ -394,10 +394,6 @@ int ACM_convert_ADPCM_to_PCM(WAVE_chunk *pwfxSrc, ubyte *src, int src_len, ubyte fmt->sample_frame_size = dest_bps/8*pwfxSrc->num_channels; - if ( !max_dest_bytes ) { - max_dest_bytes = new_size; - } - // convert to PCM rc = read_sample_fmt_adpcm(*dest, rw, fmt); diff --git a/src/sound/oal.cpp b/src/sound/oal.cpp index 41e6dc4..6e06d4c 100644 --- a/src/sound/oal.cpp +++ b/src/sound/oal.cpp @@ -896,7 +896,7 @@ int oal_load_buffer(int *sid, int *final_size, WAVE_chunk *header, sound_info *s // this ADPCM decoder decodes to 16-bit only so keep that in mind nprintf(( "Sound", "SOUND ==> converting sound from ADPCM to PCM\n" )); - int rc = ACM_convert_ADPCM_to_PCM(header, si->data, si->size, &convert_buffer, 0, &convert_len, &src_bytes_used, 16); + int rc = ACM_convert_ADPCM_to_PCM(header, si->data, si->size, &convert_buffer, &convert_len, &src_bytes_used, 16); // ACM conversion failed? if ( (rc == -1) || (src_bytes_used != si->size) ) { diff --git a/src/vcodec/codec1.cpp b/src/vcodec/codec1.cpp index 27685d1..3a36fe5 100644 --- a/src/vcodec/codec1.cpp +++ b/src/vcodec/codec1.cpp @@ -1361,8 +1361,7 @@ static int Encode1(t_Sample* bufIn, t_Sample* bufOut, int size, int sizeOut) packet.Data2 = (unsigned short)(EncTable[table][*in++]); packet.Data1 = (unsigned short)(EncTable[table][*in++]); finalPacketData = - packet.Data0 = (unsigned short)(EncTable[table][*in]); - data0 = *in++; + packet.Data0 = (unsigned short)(EncTable[table][*in++]); *(t_PacketHF1*)out = packet; out += sizeof(packet); diff --git a/src/weapon/weapons.cpp b/src/weapon/weapons.cpp index 39b3449..c50a16a 100644 --- a/src/weapon/weapons.cpp +++ b/src/weapon/weapons.cpp @@ -1591,7 +1591,7 @@ void weapon_render(object *obj) int num; weapon_info *wip; weapon *wp; - color c; + color c = { 0 }; MONITOR_INC(NumWeaponsRend, 1); -- 2.39.2