#653: Merged c1920 from branches/unstable.

This commit is contained in:
Andreas Huggel 2009-11-15 13:55:19 +00:00
parent fbad73e09f
commit 3c9c0eda35
2 changed files with 3 additions and 2 deletions

View File

@ -11,6 +11,7 @@
#include <map>
#include <cstring>
#include <cstdio>
// ! Can't include XMP..._Impl.hpp - used by both Core and Files.
#define XMP_LitNMatch(s,l,n) (std::strncmp((s),(l),(n)) == 0)

View File

@ -1172,9 +1172,9 @@ XMPUtils::ConvertToInt ( XMP_StringPtr strValue )
XMP_Int32 result;
if ( ! XMP_LitNMatch ( strValue, "0x", 2 ) ) {
count = sscanf ( strValue, "%d%c", &result, &nextCh );
count = sscanf ( strValue, "%d%c", (int*)&result, &nextCh );
} else {
count = sscanf ( strValue, "%x%c", &result, &nextCh );
count = sscanf ( strValue, "%x%c", (unsigned int*)&result, &nextCh );
}
if ( count != 1 ) XMP_Throw ( "Invalid integer string", kXMPErr_BadParam );