iliaa           Sun Dec 14 15:34:49 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/mssql  php_mssql.c 
  Log:
  
  Simplify code
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mssql/php_mssql.c?r1=1.152.2.13.2.4.2.16&r2=1.152.2.13.2.4.2.17&diff_format=u
Index: php-src/ext/mssql/php_mssql.c
diff -u php-src/ext/mssql/php_mssql.c:1.152.2.13.2.4.2.16 
php-src/ext/mssql/php_mssql.c:1.152.2.13.2.4.2.17
--- php-src/ext/mssql/php_mssql.c:1.152.2.13.2.4.2.16   Thu Dec 11 15:31:31 2008
+++ php-src/ext/mssql/php_mssql.c       Sun Dec 14 15:34:49 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_mssql.c,v 1.152.2.13.2.4.2.16 2008/12/11 15:31:31 pajoye Exp $ */
+/* $Id: php_mssql.c,v 1.152.2.13.2.4.2.17 2008/12/14 15:34:49 iliaa Exp $ */
 
 #ifdef COMPILE_DL_MSSQL
 #define HAVE_MSSQL 1
@@ -973,20 +973,14 @@
                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: {



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to