Skip to content

Commit 8f9bf2d

Browse files
authored
Update item.cpp
rm sprintf
1 parent d0c1709 commit 8f9bf2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Main/Source/item.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ void item::AddInventoryEntry(ccharacter*, festring& Entry, int Amount, truth Sho
869869
Entry << " " << GetVolume() * Amount << "cm3"; //the item can be seen therefore it's volume guessed already
870870
if(GetSecondaryMaterial()==NULL){ //simple items like ingots sticks etc
871871
static char density[20];
872-
sprintf(density, "%.1f", GetWeight()/(float)GetVolume());
872+
snprintf(density, sizeof(density), "%.1f", GetWeight()/(float)GetVolume());
873873
Entry << " " << density << "g/cm3"; //the item can be seen and weighted already so this just helps avoiding having to mentally calc density for every item
874874
if(game::WizardModeIsActive()) //TODO || Char-> possess item <materialmanual*>
875875
Entry << " " << GetStrengthValue() << "str"; //this is special info tho.

0 commit comments

Comments
 (0)