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:
Dan Villiom Podlaski Christiansen
2015-09-28 12:53:52 +02:00
parent 87a5593a4d
commit 1b8c2ca483

View File

@@ -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;
}