Skip to content

Commit 5d690de

Browse files
authored
Addendum to 53524d9
Additional tiny fixes
1 parent c684463 commit 5d690de

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

vendor/cegui-0.4.0-custom/src/tinyxml/tinyxml.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -722,9 +722,11 @@ void TiXmlElement::SetAttribute( const char * name, int val )
722722

723723
void TiXmlElement::SetDoubleAttribute( const char * name, double val )
724724
{
725-
char buf[128];
726-
sprintf( buf, "%f", val );
725+
#define TIXML_DOUBLE_BUFFER_SIZE 128
726+
char buf[TIXML_DOUBLE_BUFFER_SIZE];
727+
snprintf( buf, TIXML_DOUBLE_BUFFER_SIZE, "%f", val );
727728
SetAttribute( name, buf );
729+
#undef TIXML_DOUBLE_BUFFER_SIZE
728730
}
729731

730732

@@ -1141,7 +1143,7 @@ void TiXmlAttribute::SetIntValue( int _value )
11411143
void TiXmlAttribute::SetDoubleValue( double _value )
11421144
{
11431145
char buf [64];
1144-
sprintf (buf, "%lf", _value);
1146+
snprintf(buf, sizeof(buf), "%lf", _value);
11451147
SetValue (buf);
11461148
}
11471149

0 commit comments

Comments
 (0)