#1065. std::map<int,const char*> doesn't build on MacOS-X 10.6 (Snow Leopard). Thanks Max for letting me know about this.

v0.27.3
Robin Mills 10 years ago
parent 06a04411c6
commit af2f46c8b7

@ -412,12 +412,12 @@ namespace Exiv2 {
return result; return result;
} }
static const char* tagName(uint16_t tag,int nMaxLength) static const char* tagName(uint16_t tag,size_t nMaxLength)
{ {
const char* result = NULL; const char* result = NULL;
// build a static map of tags for fast search // build a static map of tags for fast search
static std::map<int,const char*> tags; static std::map<int,std::string> tags;
static bool init = true; static bool init = true;
static char buffer[80]; static char buffer[80];
@ -433,7 +433,7 @@ namespace Exiv2 {
init = false; init = false;
try { try {
result = tags[tag]; result = tags[tag].c_str();
if ( nMaxLength > sizeof(buffer) ) if ( nMaxLength > sizeof(buffer) )
nMaxLength = sizeof(buffer) - 2; nMaxLength = sizeof(buffer) - 2;
strncpy(buffer,result,nMaxLength); strncpy(buffer,result,nMaxLength);

Loading…
Cancel
Save