#653: Merged c1920 from branches/unstable.
This commit is contained in:
parent
fbad73e09f
commit
3c9c0eda35
@ -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)
|
||||
|
||||
@ -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 );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user