Skip to content

Commit

Permalink
Fixed two issues pointed out in a PVS-Studio static code analyzer art…
Browse files Browse the repository at this point in the history
…icle (bug #5505).
  • Loading branch information
zturtleman committed May 7, 2012
1 parent c211114 commit 2c5d0c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/cgame/cg_weapons.c
Expand Up @@ -842,7 +842,7 @@ void CG_RegisterItemVisuals( int itemNum ) {

item = &bg_itemlist[ itemNum ];

memset( itemInfo, 0, sizeof( &itemInfo ) );
memset( itemInfo, 0, sizeof( *itemInfo ) );
itemInfo->registered = qtrue;

itemInfo->models[0] = trap_R_RegisterModel( item->world_model[0] );
Expand Down
5 changes: 4 additions & 1 deletion code/ui/ui_shared.c
Expand Up @@ -3831,14 +3831,17 @@ void Item_OwnerDraw_Paint(itemDef_t *item) {

void Item_Paint(itemDef_t *item) {
vec4_t red;
menuDef_t *parent = (menuDef_t*)item->parent;
menuDef_t *parent;

red[0] = red[3] = 1;
red[1] = red[2] = 0;

if (item == NULL) {
return;
}

parent = (menuDef_t*)item->parent;

if (item->window.flags & WINDOW_ORBITING) {
if (DC->realTime > item->window.nextTime) {
float rx, ry, a, c, s, w, h;
Expand Down

0 comments on commit 2c5d0c1

Please sign in to comment.