File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
vendor/cegui-0.4.0-custom/src/tinyxml Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -722,9 +722,11 @@ void TiXmlElement::SetAttribute( const char * name, int val )
722
722
723
723
void TiXmlElement::SetDoubleAttribute ( const char * name, double val )
724
724
{
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 );
727
728
SetAttribute ( name, buf );
729
+ #undef TIXML_DOUBLE_BUFFER_SIZE
728
730
}
729
731
730
732
@@ -1141,7 +1143,7 @@ void TiXmlAttribute::SetIntValue( int _value )
1141
1143
void TiXmlAttribute::SetDoubleValue ( double _value )
1142
1144
{
1143
1145
char buf [64 ];
1144
- sprintf (buf, " %lf" , _value);
1146
+ snprintf (buf, sizeof (buf) , " %lf" , _value);
1145
1147
SetValue (buf);
1146
1148
}
1147
1149
You can’t perform that action at this time.
0 commit comments