Skip to content

Commit db28ab6

Browse files
committed
Decrease float string buffer sizes from 64 to 32
1 parent 0455798 commit db28ab6

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

GeneralsMD/Code/Tools/WorldBuilder/src/BuildList.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ void BuildList::OnSelchangeBuildList()
449449
PointerTool::clearSelection(); // unselect other stuff.
450450
if (pBuildInfo) {
451451
CWnd *edit;
452-
static char buff[64];
452+
static char buff[32];
453453
pBuildInfo->setSelected(true);
454454

455455
m_angle = pBuildInfo->getAngle() * 180/PI;
@@ -638,7 +638,7 @@ void BuildList::PopSliderChanged(const long sliderID, long theVal)
638638
{
639639
// CWorldBuilderDoc* pDoc = CWorldBuilderDoc::GetActiveDoc();
640640
CWnd* edit;
641-
static char buff[64];
641+
static char buff[32];
642642
switch (sliderID) {
643643
case IDC_HEIGHT_POPUP:
644644
m_height = theVal;

GeneralsMD/Code/Tools/WorldBuilder/src/MeshMoldOptions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ BOOL MeshMoldOptions::OnInitDialog()
148148

149149
void MeshMoldOptions::setHeight(Real height)
150150
{
151-
char buffer[64];
151+
char buffer[32];
152152
snprintf(buffer, ARRAY_SIZE(buffer), "%.2f", height);
153153
m_currentHeight = height;
154154
if (m_staticThis && !m_staticThis->m_updating) {

GeneralsMD/Code/Tools/WorldBuilder/src/mapobjectprops.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ void MapObjectProps::_ScaleToDict(void)
472472
void MapObjectProps::ShowZOffset(MapObject *pMapObj)
473473
{
474474
const Coord3D *loc = pMapObj->getLocation();
475-
static char buff[64];
475+
static char buff[32];
476476
m_height = loc->z;
477477
snprintf(buff, ARRAY_SIZE(buff), "%0.2f", loc->z);
478478
CWnd* edit = GetDlgItem(IDC_MAPOBJECT_ZOffset);
@@ -504,7 +504,7 @@ void MapObjectProps::SetZOffset(void)
504504
void MapObjectProps::ShowAngle(MapObject *pMapObj)
505505
{
506506
m_angle = pMapObj->getAngle() * 180 / PI;
507-
static char buff[64];
507+
static char buff[32];
508508
snprintf(buff, ARRAY_SIZE(buff), "%0.2f", m_angle);
509509
CWnd* edit = GetDlgItem(IDC_MAPOBJECT_Angle);
510510
edit->SetWindowText(buff);
@@ -515,7 +515,7 @@ void MapObjectProps::ShowAngle(MapObject *pMapObj)
515515
void MapObjectProps::ShowPosition(MapObject *pMapObj)
516516
{
517517
m_position = *pMapObj->getLocation();
518-
static char buff[128];
518+
static char buff[64];
519519
snprintf(buff, ARRAY_SIZE(buff), "%0.2f, %0.2f", m_position.x, m_position.y);
520520
CWnd* edit = GetDlgItem(IDC_MAPOBJECT_XYPosition);
521521
edit->SetWindowText(buff);
@@ -617,7 +617,7 @@ void MapObjectProps::PopSliderChanged(const long sliderID, long theVal)
617617
return;
618618

619619
CWnd* edit;
620-
static char buff[64];
620+
static char buff[32];
621621
switch (sliderID) {
622622
case IDC_HEIGHT_POPUP:
623623
if (!m_posUndoable) {
@@ -1124,7 +1124,7 @@ void MapObjectProps::_DictToStoppingDistance(void)
11241124

11251125
CWnd* pItem = GetDlgItem(IDC_MAPOBJECT_StoppingDistance);
11261126
if (pItem) {
1127-
static char buff[64];
1127+
static char buff[32];
11281128
snprintf(buff, ARRAY_SIZE(buff), "%g", stoppingDistance);
11291129
pItem->SetWindowText(buff);
11301130
}

0 commit comments

Comments
 (0)