Skip to content
Browse files

Simplify code

  • Loading branch information...
1 parent e23b2b3 commit 830be669ccdd2949f06e5da7b10c5f4e22af9b89 Ilia Alshanetsky committed Dec 14, 2008
Showing with 2 additions and 8 deletions.
  1. +2 −8 ext/mssql/php_mssql.c
View
10 ext/mssql/php_mssql.c
@@ -973,20 +973,14 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
case SQLVARBINARY:
case SQLBINARY:
case SQLIMAGE: {
- DBBINARY *bin;
- unsigned char *res_buf;
int res_length = dbdatlen(mssql_ptr->link, offset);
if (!res_length) {
ZVAL_NULL(result);
} else {
- bin = ((DBBINARY *)dbdata(mssql_ptr->link, offset));
- res_buf = (unsigned char *) emalloc(res_length+1);
- memcpy(res_buf,bin,res_length);
- res_buf[res_length] = '\0';
- ZVAL_STRINGL(result, res_buf, res_length, 0);
- }
+ ZVAL_STRINGL(result, (char *)dbdata(mssql_ptr->link, offset)), res_length, 1);
}
+ }
break;
case SQLNUMERIC:
default: {

0 comments on commit 830be66

Please sign in to comment.
Something went wrong with that request. Please try again.