Fix format-overflow warnings by using bigger buffer

v0.27.3
Luis Díaz Más 6 years ago committed by Luis Diaz
parent b7bd0988d5
commit 20a9e5affe

@ -2050,8 +2050,8 @@ namespace {
pthread_mutex_lock( &cs ); pthread_mutex_lock( &cs );
std::string tmp = "/tmp/"; std::string tmp = "/tmp/";
#endif #endif
char sCount[12]; char sCount[13];
sprintf(sCount,"_%d",++count); sprintf(sCount,"_%d",++count); /// \todo replace by std::snprintf on master
std::string result = tmp + Exiv2::toString(pid) + sCount ; std::string result = tmp + Exiv2::toString(pid) + sCount ;
if ( Exiv2::fileExists(result) ) std::remove(result.c_str()); if ( Exiv2::fileExists(result) ) std::remove(result.c_str());

@ -602,7 +602,8 @@ namespace Exiv2 {
// 0xc0 .. 0xcf are SOFn (except 4) // 0xc0 .. 0xcf are SOFn (except 4)
nm[0xc4] = "DHT"; nm[0xc4] = "DHT";
for (int i = 0; i <= 15; i++) { for (int i = 0; i <= 15; i++) {
char MN[10]; char MN[16];
/// \todo to be replaced by std::snprintf on master (only available in c++11)
sprintf(MN, "APP%d", i); sprintf(MN, "APP%d", i);
nm[0xe0 + i] = MN; nm[0xe0 + i] = MN;
if (i != 4) { if (i != 4) {

Loading…
Cancel
Save