]> granicus.if.org Git - php/commitdiff
minor improvements
authorAntony Dovgal <tony2001@php.net>
Thu, 28 Dec 2006 14:17:09 +0000 (14:17 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 28 Dec 2006 14:17:09 +0000 (14:17 +0000)
ext/ereg/ereg.c
ext/sockets/sockets.c
ext/standard/reg.c

index a9ebaaee88923b8f1b2b10a878521aead0678f6a..952a9cee3531b5d3fe4bbe7faee2121f1c028271 100644 (file)
@@ -425,7 +425,7 @@ PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const cha
                                buf = nbuf;
                        }
                        /* stick that last bit of string on our output */
-                       strcat(buf, &string[pos]);
+                       strlcat(buf, &string[pos], buf_len);
                }
        }
 
index 60d762389499ad31e1cb7c0348ec7824b1eb4a5f..417f841727bbd7a6b3677e7043fd44b0711bc187 100644 (file)
@@ -1627,11 +1627,12 @@ PHP_FUNCTION(socket_set_option)
 {
        zval                    *arg1, **arg4;
        struct linger   lv;
-       struct timeval tv;
        php_socket              *php_sock;
        int                             ov, optlen, retval; 
 #ifdef PHP_WIN32
        int                             timeout;
+#else 
+       struct timeval tv;
 #endif
        long                            level, optname;
        void                    *opt_ptr;
index a9ebaaee88923b8f1b2b10a878521aead0678f6a..952a9cee3531b5d3fe4bbe7faee2121f1c028271 100644 (file)
@@ -425,7 +425,7 @@ PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const cha
                                buf = nbuf;
                        }
                        /* stick that last bit of string on our output */
-                       strcat(buf, &string[pos]);
+                       strlcat(buf, &string[pos], buf_len);
                }
        }