cvs: php4 /ext/standard file.c
| From: | Andi Gutmans | Date: | Wed, 01 Nov 2000 14:48:00 +0000 |
| Subject: | cvs: php4 /ext/standard file.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2398@lists.php.net to get a copy of this message | ||
andi Wed Nov 1 06:48:00 2000 EDT
Modified files:
/php4/ext/standard file.c
Log:
- Change some estrdup()'s to estrndup()'s
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.121 php4/ext/standard/file.c:1.122
--- php4/ext/standard/file.c:1.121 Tue Oct 31 10:05:19 2000
+++ php4/ext/standard/file.c Wed Nov 1 06:48:00 2000
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.121 2000/10/31 18:05:19 zeev Exp $ */
+/* $Id: file.c,v 1.122 2000/11/01 14:48:00 andi Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -274,7 +274,7 @@
fp = php_fopen_wrapper((*filename)->value.str.val,"r",
use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
if (!fp && !socketd) {
if (issock != BAD_URL) {
- char *tmp = estrdup((*filename)->value.str.val);
+ char *tmp = estrndup(Z_STRVAL_PP(filename), Z_STRLEN_PP(filename));
php_strip_url_passwd(tmp);
php_error(E_WARNING,"get_meta_tags(\"%s\") - %s", tmp, strerror(errno));
efree(tmp);
@@ -408,7 +408,7 @@
fp = php_fopen_wrapper((*filename)->value.str.val,"r",
use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
if (!fp && !socketd) {
if (issock != BAD_URL) {
- char *tmp = estrdup((*filename)->value.str.val);
+ char *tmp = estrndup(Z_STRVAL_PP(filename), Z_STRLEN_PP(filename));
php_strip_url_passwd(tmp);
php_error(E_WARNING,"file(\"%s\") - %s", tmp, strerror(errno));
efree(tmp);
@@ -484,10 +484,9 @@
}
convert_to_string_ex(arg1);
convert_to_string_ex(arg2);
- d = estrndup((*arg1)->value.str.val,(*arg1)->value.str.len);
- strlcpy(p,(*arg2)->value.str.val,sizeof(p));
+ d = estrndup(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1));
+ strlcpy(p, Z_STRVAL_PP(arg2), sizeof(p));
-
if ((fp = php_open_temporary_file(d, p, &opened_path))) {
fclose(fp);
RETVAL_STRING(opened_path, 0);
@@ -555,7 +554,7 @@
fp = php_fopen_wrapper((*arg1)->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE,
&issock, &socketd, NULL);
if (!fp && !socketd) {
if (issock != BAD_URL) {
- char *tmp = estrdup((*arg1)->value.str.val);
+ char *tmp = estrndup(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1));
php_strip_url_passwd(tmp);
php_error(E_WARNING,"fopen(\"%s\",\"%s\") - %s", tmp, p,
strerror(errno));
efree(tmp);
@@ -644,7 +643,7 @@
RETURN_FALSE;
}
} else {
- fp = V_POPEN((*arg1)->value.str.val,p);
+ fp = V_POPEN((*arg1)->value.str.val, p);
if (!fp) {
php_error(E_WARNING,"popen(\"%s\",\"%s\") -
%s",(*arg1)->value.str.val,p,strerror(errno));
efree(p);
@@ -1408,7 +1407,7 @@
fp = php_fopen_wrapper((*arg1)->value.str.val,"r",
use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
if (!fp && !socketd){
if (issock != BAD_URL) {
- char *tmp = estrdup((*arg1)->value.str.val);
+ char *tmp = estrndup(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1));
php_strip_url_passwd(tmp);
php_error(E_WARNING,"readfile(\"%s\") - %s", tmp, strerror(errno));
efree(tmp);