mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-19 09:47:20 +01:00
* applied two patches by Vadim Zhukov persgray@gmail.com to
replace calls to sprintf with safer calls to snprintf and fix some compiler warnings.
This commit is contained in:
parent
6046524a37
commit
e0be917ef2
@ -1,5 +1,9 @@
|
||||
2011-07-06 Vadim Kurland <vadim@netcitadel.com>
|
||||
|
||||
* applied two patches by Vadim Zhukov persgray@gmail.com to
|
||||
replace calls to sprintf with safer calls to snprintf and fix some
|
||||
compiler warnings.
|
||||
|
||||
* Importer.cpp (addStandardImportComment): see #2552 "PF import:
|
||||
add ability to suppress comments referring to line numbers in the
|
||||
original file".
|
||||
|
||||
@ -21,24 +21,25 @@ namespace antlr {
|
||||
|
||||
// wh: hack for Borland C++ 5.6
|
||||
#if __BORLANDC__
|
||||
using std::sprintf;
|
||||
using std::snprintf;
|
||||
#endif
|
||||
|
||||
|
||||
// RK: should be using snprintf actually... (or stringstream)
|
||||
ANTLR_C_USING(sprintf)
|
||||
ANTLR_C_USING(snprintf)
|
||||
|
||||
ANTLR_USE_NAMESPACE(std)string operator+( const ANTLR_USE_NAMESPACE(std)string& lhs, const int rhs )
|
||||
{
|
||||
char tmp[100];
|
||||
sprintf(tmp,"%d",rhs);
|
||||
snprintf(tmp, sizeof(tmp), "%d", rhs);
|
||||
return lhs+tmp;
|
||||
}
|
||||
|
||||
ANTLR_USE_NAMESPACE(std)string operator+( const ANTLR_USE_NAMESPACE(std)string& lhs, size_t rhs )
|
||||
{
|
||||
char tmp[100];
|
||||
sprintf(tmp,"%u",rhs);
|
||||
snprintf(tmp, sizeof(tmp), "%zu", rhs);
|
||||
// sprintf(tmp,"%u",rhs);
|
||||
return lhs+tmp;
|
||||
}
|
||||
|
||||
|
||||
@ -317,6 +317,7 @@ ObjectSignature::ObjectSignature(ObjectMakerErrorTracker *et)
|
||||
}
|
||||
|
||||
ObjectSignature::ObjectSignature(const ObjectSignature &other)
|
||||
: libfwbuilder::Dispatch(other)
|
||||
{
|
||||
error_tracker = other.error_tracker;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user