Index: ext/sybase_ct/php_sybase_ct.c =================================================================== RCS file: /repository/php-src/ext/sybase_ct/php_sybase_ct.c,v retrieving revision 1.93 diff -u -r1.93 php_sybase_ct.c --- ext/sybase_ct/php_sybase_ct.c 16 Apr 2004 16:27:13 -0000 1.93 +++ ext/sybase_ct/php_sybase_ct.c 14 May 2004 15:27:12 -0000 @@ -1135,6 +1135,13 @@ * will be become an int. */ convert_to_double(&result->data[i][j]); + + /* If the result is smaller than LONG_MAX, it would still fit into + * an int, so convert it. + */ + if (result->data[i][j].value.dval <= (double)LONG_MAX) { + convert_to_long(&result->data[i][j]); + } break; } }