[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqlnd mysqlnd.c mysqlnd_debug.h mysqlnd_enum_n_def.h mysqlnd_loaddata.c mysqlnd_palloc.h mysqlnd_priv.h mysqlnd_result.h mysqlnd_result_meta.h mysqlnd_statistics

2008-01-08 Thread Andrey Hristov
andrey  Tue Jan  8 13:11:55 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/mysqlndmysqlnd.c mysqlnd_debug.h mysqlnd_enum_n_def.h 
mysqlnd_loaddata.c mysqlnd_palloc.h 
mysqlnd_priv.h mysqlnd_result.h 
mysqlnd_result_meta.h mysqlnd_statistics.h 
mysqlnd_wireprotocol.c mysqlnd_wireprotocol.h 
php_mysqlnd.h 
  Log:
  strncpy-strlcpy
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.5.2.6r2=1.5.2.7diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd.c
diff -u php-src/ext/mysqlnd/mysqlnd.c:1.5.2.6 
php-src/ext/mysqlnd/mysqlnd.c:1.5.2.7
--- php-src/ext/mysqlnd/mysqlnd.c:1.5.2.6   Wed Jan  2 21:14:34 2008
+++ php-src/ext/mysqlnd/mysqlnd.c   Tue Jan  8 13:11:55 2008
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: mysqlnd.c,v 1.5.2.6 2008/01/02 21:14:34 andrey Exp $ */
+/* $Id: mysqlnd.c,v 1.5.2.7 2008/01/08 13:11:55 andrey Exp $ */
 #include php.h
 #include mysqlnd.h
 #include mysqlnd_wireprotocol.h
@@ -676,14 +676,14 @@
} else if (ok_packet.field_count == 0xFF) {
if (ok_packet.sqlstate[0]) {
if (!self_alloced) {
-   strncpy(conn-error_info.sqlstate, 
ok_packet.sqlstate, sizeof(conn-error_info.sqlstate));
+   strlcpy(conn-error_info.sqlstate, 
ok_packet.sqlstate, sizeof(conn-error_info.sqlstate));
}
DBG_ERR_FMT(ERROR:%d [SQLSTATE:%s] %s,
ok_packet.error_no, 
ok_packet.sqlstate, ok_packet.error);
}
if (!self_alloced) {
conn-error_info.error_no = ok_packet.error_no;
-   strncpy(conn-error_info.error, 
ok_packet.error, sizeof(conn-error_info.error));
+   strlcpy(conn-error_info.error, 
ok_packet.error, sizeof(conn-error_info.error));
}
}
} else {
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_debug.h?r1=1.1.2.4r2=1.1.2.5diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_debug.h
diff -u php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.4 
php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.5
--- php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.4 Mon Dec 31 07:17:10 2007
+++ php-src/ext/mysqlnd/mysqlnd_debug.h Tue Jan  8 13:11:55 2008
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: mysqlnd_debug.h,v 1.1.2.4 2007/12/31 07:17:10 sebastian Exp $ */
+/* $Id: mysqlnd_debug.h,v 1.1.2.5 2008/01/08 13:11:55 andrey Exp $ */
 
 #ifndef MYSQLND_DEBUG_H
 #define MYSQLND_DEBUG_H
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_enum_n_def.h?r1=1.2.2.3r2=1.2.2.4diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_enum_n_def.h
diff -u php-src/ext/mysqlnd/mysqlnd_enum_n_def.h:1.2.2.3 
php-src/ext/mysqlnd/mysqlnd_enum_n_def.h:1.2.2.4
--- php-src/ext/mysqlnd/mysqlnd_enum_n_def.h:1.2.2.3Mon Dec 31 07:17:10 2007
+++ php-src/ext/mysqlnd/mysqlnd_enum_n_def.hTue Jan  8 13:11:55 2008
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: mysqlnd_enum_n_def.h,v 1.2.2.3 2007/12/31 07:17:10 sebastian Exp $ */
+/* $Id: mysqlnd_enum_n_def.h,v 1.2.2.4 2008/01/08 13:11:55 andrey Exp $ */
 #ifndef MYSQLND_ENUM_N_DEF_H
 #define MYSQLND_ENUM_N_DEF_H
 
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_loaddata.c?r1=1.2.2.3r2=1.2.2.4diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_loaddata.c
diff -u php-src/ext/mysqlnd/mysqlnd_loaddata.c:1.2.2.3 
php-src/ext/mysqlnd/mysqlnd_loaddata.c:1.2.2.4
--- php-src/ext/mysqlnd/mysqlnd_loaddata.c:1.2.2.3  Mon Dec 31 07:17:10 2007
+++ php-src/ext/mysqlnd/mysqlnd_loaddata.c  Tue Jan  8 13:11:55 2008
@@ -113,7 +113,7 @@
DBG_ENTER(mysqlnd_local_infile_error);
 
if (info) {
-   strncpy(error_buf, info-error_msg, error_buf_len);
+   strlcpy(error_buf, info-error_msg, error_buf_len);
DBG_INF_FMT(have info, %d, info-error_no);
DBG_RETURN(info-error_no);
}
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_palloc.h?r1=1.2.2.3r2=1.2.2.4diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_palloc.h
diff -u php-src/ext/mysqlnd/mysqlnd_palloc.h:1.2.2.3 
php-src/ext/mysqlnd/mysqlnd_palloc.h:1.2.2.4
--- php-src/ext/mysqlnd/mysqlnd_palloc.h:1.2.2.3Mon Dec 31 07:17:10 2007
+++ php-src/ext/mysqlnd/mysqlnd_palloc.hTue Jan  8 13:11:55 2008
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: mysqlnd_palloc.h,v 1.2.2.3 2007/12/31 

Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqlnd mysqlnd.c mysqlnd_debug.h

2007-10-24 Thread Andrey Hristov
 Hallo Marcus,
Marcus Boerger wrote:
 Hello Andrey,
 
   basically you cannot use any define. And when you want to be platform
 agnostic/independent then you must assume all posix/c-api functions are
 defines.

I already suspected this when I wrote the code but gcc had no probs with
it. The windows error came as surprise to me, but anyway lesson learnt.

 marcus
 
 Tuesday, October 23, 2007, 12:10:18 PM, you wrote:
 
 andrey  Tue Oct 23 10:10:18 2007 UTC
 
   Modified files:  (Branch: PHP_5_3)
 /php-src/ext/mysqlndmysqlnd.c mysqlnd_debug.h 
   Log:
   Fix build failure on Windows. Seems free can't be used even as method
 name of a structure. The MS compiler (the
 preprocessor most probably) changes it to _free_dbg
   
 http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.5.2.2r2=1.5.2.3diff_format=u
 Index: php-src/ext/mysqlnd/mysqlnd.c
 diff -u php-src/ext/mysqlnd/mysqlnd.c:1.5.2.2
 php-src/ext/mysqlnd/mysqlnd.c:1.5.2.3
 --- php-src/ext/mysqlnd/mysqlnd.c:1.5.2.2   Fri Oct  5 21:23:56 2007
 +++ php-src/ext/mysqlnd/mysqlnd.c   Tue Oct 23 10:10:18 2007
 @@ -18,7 +18,7 @@
+--+
  */
  
 -/* $Id: mysqlnd.c,v 1.5.2.2 2007/10/05 21:23:56 andrey Exp $ */
 +/* $Id: mysqlnd.c,v 1.5.2.3 2007/10/23 10:10:18 andrey Exp $ */
  #include php.h
  #include mysqlnd.h
  #include mysqlnd_wireprotocol.h
 @@ -2032,7 +2032,7 @@
 DBG_ENTER(RSHUTDOWN);
 if (dbg) {
 dbg-m-close(dbg);
 -   dbg-m-free(dbg);
 +   dbg-m-free_handle(dbg);
 MYSQLND_G(dbg) = NULL;
 }
  #endif
 http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_debug.h?r1=1.1.2.2r2=1.1.2.3diff_format=u
 Index: php-src/ext/mysqlnd/mysqlnd_debug.h
 diff -u php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.2
 php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.3
 --- php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.2 Fri Oct  5 21:23:56 2007
 +++ php-src/ext/mysqlnd/mysqlnd_debug.h Tue Oct 23 10:10:18 2007
 @@ -18,7 +18,7 @@
+--+
  */
  
 -/* $Id: mysqlnd_debug.h,v 1.1.2.2 2007/10/05 21:23:56 andrey Exp $ */
 +/* $Id: mysqlnd_debug.h,v 1.1.2.3 2007/10/23 10:10:18 andrey Exp $ */
  
  #ifndef MYSQLND_DEBUG_H
  #define MYSQLND_DEBUG_H
 @@ -39,7 +39,7 @@
 char * func_name, 
 uint func_name_len);
 enum_func_status (*func_leave)(MYSQLND_DEBUG *self, unsigned int 
 line, const char * const file);
 enum_func_status (*close)(MYSQLND_DEBUG *self);
 -   enum_func_status (*free)(MYSQLND_DEBUG *self);
 +   enum_func_status (*free_handle)(MYSQLND_DEBUG *self);
  };
  
  struct st_mysqlnd_debug
 
 
 
 
 Best regards,
  Marcus
 

Grüße,
Andrey

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqlnd mysqlnd.c mysqlnd_debug.h

2007-10-23 Thread Andrey Hristov
andrey  Tue Oct 23 10:10:18 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/mysqlndmysqlnd.c mysqlnd_debug.h 
  Log:
  Fix build failure on Windows. Seems free can't be used even as method name 
of a structure. The MS compiler (the preprocessor most probably) changes it to 
_free_dbg
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.5.2.2r2=1.5.2.3diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd.c
diff -u php-src/ext/mysqlnd/mysqlnd.c:1.5.2.2 
php-src/ext/mysqlnd/mysqlnd.c:1.5.2.3
--- php-src/ext/mysqlnd/mysqlnd.c:1.5.2.2   Fri Oct  5 21:23:56 2007
+++ php-src/ext/mysqlnd/mysqlnd.c   Tue Oct 23 10:10:18 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: mysqlnd.c,v 1.5.2.2 2007/10/05 21:23:56 andrey Exp $ */
+/* $Id: mysqlnd.c,v 1.5.2.3 2007/10/23 10:10:18 andrey Exp $ */
 #include php.h
 #include mysqlnd.h
 #include mysqlnd_wireprotocol.h
@@ -2032,7 +2032,7 @@
DBG_ENTER(RSHUTDOWN);
if (dbg) {
dbg-m-close(dbg);
-   dbg-m-free(dbg);
+   dbg-m-free_handle(dbg);
MYSQLND_G(dbg) = NULL;
}
 #endif
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_debug.h?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_debug.h
diff -u php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.2 
php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.3
--- php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.2 Fri Oct  5 21:23:56 2007
+++ php-src/ext/mysqlnd/mysqlnd_debug.h Tue Oct 23 10:10:18 2007
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: mysqlnd_debug.h,v 1.1.2.2 2007/10/05 21:23:56 andrey Exp $ */
+/* $Id: mysqlnd_debug.h,v 1.1.2.3 2007/10/23 10:10:18 andrey Exp $ */
 
 #ifndef MYSQLND_DEBUG_H
 #define MYSQLND_DEBUG_H
@@ -39,7 +39,7 @@
char * func_name, uint 
func_name_len);
enum_func_status (*func_leave)(MYSQLND_DEBUG *self, unsigned int line, 
const char * const file);
enum_func_status (*close)(MYSQLND_DEBUG *self);
-   enum_func_status (*free)(MYSQLND_DEBUG *self);
+   enum_func_status (*free_handle)(MYSQLND_DEBUG *self);
 };
 
 struct st_mysqlnd_debug

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/mysqlnd mysqlnd.c mysqlnd_debug.h

2007-10-23 Thread Marcus Boerger
Hello Andrey,

  basically you cannot use any define. And when you want to be platform
agnostic/independent then you must assume all posix/c-api functions are
defines.

marcus

Tuesday, October 23, 2007, 12:10:18 PM, you wrote:

 andrey  Tue Oct 23 10:10:18 2007 UTC

   Modified files:  (Branch: PHP_5_3)
 /php-src/ext/mysqlndmysqlnd.c mysqlnd_debug.h 
   Log:
   Fix build failure on Windows. Seems free can't be used even as method
 name of a structure. The MS compiler (the
 preprocessor most probably) changes it to _free_dbg
   
 http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.5.2.2r2=1.5.2.3diff_format=u
 Index: php-src/ext/mysqlnd/mysqlnd.c
 diff -u php-src/ext/mysqlnd/mysqlnd.c:1.5.2.2
 php-src/ext/mysqlnd/mysqlnd.c:1.5.2.3
 --- php-src/ext/mysqlnd/mysqlnd.c:1.5.2.2   Fri Oct  5 21:23:56 2007
 +++ php-src/ext/mysqlnd/mysqlnd.c   Tue Oct 23 10:10:18 2007
 @@ -18,7 +18,7 @@
+--+
  */
  
 -/* $Id: mysqlnd.c,v 1.5.2.2 2007/10/05 21:23:56 andrey Exp $ */
 +/* $Id: mysqlnd.c,v 1.5.2.3 2007/10/23 10:10:18 andrey Exp $ */
  #include php.h
  #include mysqlnd.h
  #include mysqlnd_wireprotocol.h
 @@ -2032,7 +2032,7 @@
 DBG_ENTER(RSHUTDOWN);
 if (dbg) {
 dbg-m-close(dbg);
 -   dbg-m-free(dbg);
 +   dbg-m-free_handle(dbg);
 MYSQLND_G(dbg) = NULL;
 }
  #endif
 http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_debug.h?r1=1.1.2.2r2=1.1.2.3diff_format=u
 Index: php-src/ext/mysqlnd/mysqlnd_debug.h
 diff -u php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.2
 php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.3
 --- php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.2 Fri Oct  5 21:23:56 2007
 +++ php-src/ext/mysqlnd/mysqlnd_debug.h Tue Oct 23 10:10:18 2007
 @@ -18,7 +18,7 @@
+--+
  */
  
 -/* $Id: mysqlnd_debug.h,v 1.1.2.2 2007/10/05 21:23:56 andrey Exp $ */
 +/* $Id: mysqlnd_debug.h,v 1.1.2.3 2007/10/23 10:10:18 andrey Exp $ */
  
  #ifndef MYSQLND_DEBUG_H
  #define MYSQLND_DEBUG_H
 @@ -39,7 +39,7 @@
 char * func_name, 
 uint func_name_len);
 enum_func_status (*func_leave)(MYSQLND_DEBUG *self, unsigned int 
 line, const char * const file);
 enum_func_status (*close)(MYSQLND_DEBUG *self);
 -   enum_func_status (*free)(MYSQLND_DEBUG *self);
 +   enum_func_status (*free_handle)(MYSQLND_DEBUG *self);
  };
  
  struct st_mysqlnd_debug




Best regards,
 Marcus

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