mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-18 18:22:07 +08:00
odbc: don't assume sizeof(int) == sizeof(long)
Most 64-bit environments use 64 bit longs and 32 bit ints; as such, comparing an int to LONG_MIN/MAX makes no sense. Since SQL LONGs appear limited to 32 bits, I assume INT_MIN/MAX was intended.
This commit is contained in:
@@ -1737,7 +1737,7 @@ static SQLRETURN SQL_API _SQLGetData(
|
||||
break;
|
||||
case SQL_C_LONG:
|
||||
case SQL_C_SLONG:
|
||||
if (intValue<LONG_MIN || intValue>LONG_MAX) {
|
||||
if (intValue<INT_MIN || intValue>INT_MAX) {
|
||||
strcpy(sqlState, "22003"); // Numeric value out of range
|
||||
return SQL_ERROR;
|
||||
}
|
||||
|
Reference in New Issue
Block a user