cvs: php4 /ext/dba dba.c /ext/standard dir.c /main fopen-wrappers.c safe_mode.c /sapi/phttpd phttpd.c /sapi/servlet servlet.c
| From: | Andi Gutmans | Date: | Sat, 16 Dec 2000 20:52:44 +0000 |
| Subject: | cvs: php4 /ext/dba dba.c /ext/standard dir.c /main fopen-wrappers.c safe_mode.c /sapi/phttpd phttpd.c /sapi/servlet servlet.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-3188@lists.php.net to get a copy of this message | ||
andi Sat Dec 16 12:52:44 2000 EDT
Modified files:
/php4/ext/dba dba.c
/php4/ext/standard dir.c
/php4/main fopen-wrappers.c safe_mode.c
/php4/sapi/phttpd phttpd.c
/php4/sapi/servlet servlet.c
Log:
- Make all places use MAXPATHLEN in the same way. It includes the
terminating NULL.
Index: php4/ext/dba/dba.c
diff -u php4/ext/dba/dba.c:1.29 php4/ext/dba/dba.c:1.30
--- php4/ext/dba/dba.c:1.29 Mon Dec 4 02:22:46 2000
+++ php4/ext/dba/dba.c Sat Dec 16 12:52:42 2000
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba.c,v 1.29 2000/12/04 10:22:46 sas Exp $ */
+/* $Id: dba.c,v 1.30 2000/12/16 20:52:42 andi Exp $ */
#include "php.h"
@@ -211,11 +211,21 @@
static PHP_MINFO_FUNCTION(dba)
{
dba_handler *hptr;
+<<<<<<< dba.c
+ static char handlers[80];
+=======
smart_str handlers = {0};
+>>>>>>> 1.28
+ handlers[0] = '\0';
+
for(hptr = handler; hptr->name; hptr++) {
+<<<<<<< dba.c
+ strlcat(handlers, hptr->name, sizeof(handlers));
+=======
smart_str_appends(&handlers, hptr->name);
smart_str_appendc(&handlers, ' ');
+>>>>>>> 1.28
}
php_info_print_table_start();
Index: php4/ext/standard/dir.c
diff -u php4/ext/standard/dir.c:1.51 php4/ext/standard/dir.c:1.52
--- php4/ext/standard/dir.c:1.51 Thu Dec 7 04:09:37 2000
+++ php4/ext/standard/dir.c Sat Dec 16 12:52:43 2000
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dir.c,v 1.51 2000/12/07 12:09:37 sas Exp $ */
+/* $Id: dir.c,v 1.52 2000/12/16 20:52:43 andi Exp $ */
/* {{{ includes/startup/misc */
@@ -259,7 +259,7 @@
}
#if HAVE_GETCWD
- ret = V_GETCWD(path,MAXPATHLEN-1);
+ ret = V_GETCWD(path, MAXPATHLEN);
#elif HAVE_GETWD
ret = V_GETWD(path);
/*
Index: php4/main/fopen-wrappers.c
diff -u php4/main/fopen-wrappers.c:1.108 php4/main/fopen-wrappers.c:1.109
--- php4/main/fopen-wrappers.c:1.108 Thu Dec 14 15:05:31 2000
+++ php4/main/fopen-wrappers.c Sat Dec 16 12:52:43 2000
@@ -16,7 +16,7 @@
| Jim Winstead <jimw@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: fopen-wrappers.c,v 1.108 2000/12/14 23:05:31 andi Exp $ */
+/* $Id: fopen-wrappers.c,v 1.109 2000/12/16 20:52:43 andi Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -360,7 +360,7 @@
PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **opened_path)
{
char *pathbuf, *ptr, *end;
- char trypath[MAXPATHLEN + 1];
+ char trypath[MAXPATHLEN];
struct stat sb;
FILE *fp;
int filename_length;
@@ -513,7 +513,7 @@
PHPAPI char *expand_filepath(const char *filepath, char *real_path)
{
cwd_state new_state;
- char cwd[MAXPATHLEN+1];
+ char cwd[MAXPATHLEN];
char *result;
result = V_GETCWD(cwd, MAXPATHLEN);
Index: php4/main/safe_mode.c
diff -u php4/main/safe_mode.c:1.23 php4/main/safe_mode.c:1.24
--- php4/main/safe_mode.c:1.23 Wed Nov 1 10:05:27 2000
+++ php4/main/safe_mode.c Sat Dec 16 12:52:43 2000
@@ -15,7 +15,7 @@
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
-/* $Id: safe_mode.c,v 1.23 2000/11/01 18:05:27 andi Exp $ */
+/* $Id: safe_mode.c,v 1.24 2000/12/16 20:52:43 andi Exp $ */
#include "php.h"
@@ -106,7 +106,7 @@
}
duid = sb.st_uid;
} else {
- char cwd[MAXPATHLEN+1];
+ char cwd[MAXPATHLEN];
if (!V_GETCWD(cwd, MAXPATHLEN)) {
php_error(E_WARNING, "Unable to access current working directory");
return 0;
Index: php4/sapi/phttpd/phttpd.c
diff -u php4/sapi/phttpd/phttpd.c:1.22 php4/sapi/phttpd/phttpd.c:1.23
--- php4/sapi/phttpd/phttpd.c:1.22 Fri Nov 17 18:44:03 2000
+++ php4/sapi/phttpd/phttpd.c Sat Dec 16 12:52:43 2000
@@ -203,7 +203,7 @@
SG(request_info).query_string = PHG(cip)->hip->request;
SG(request_info).request_method = PHG(cip)->hip->method;
- SG(request_info).path_translated = malloc(MAXPATHLEN+1);
+ SG(request_info).path_translated = malloc(MAXPATHLEN);
SG(sapi_headers).http_response_code = 200;
if (url_expand(PHG(cip)->hip->url, SG(request_info).path_translated, MAXPATHLEN,
&PHG(sb), NULL, NULL) == NULL) {
/* handle error */
Index: php4/sapi/servlet/servlet.c
diff -u php4/sapi/servlet/servlet.c:1.41 php4/sapi/servlet/servlet.c:1.42
--- php4/sapi/servlet/servlet.c:1.41 Fri Dec 15 16:15:55 2000
+++ php4/sapi/servlet/servlet.c Sat Dec 16 12:52:43 2000
@@ -327,7 +327,7 @@
zend_file_handle file_handle;
#ifndef VIRTUAL_DIR
- char cwd[MAXPATHLEN+1];
+ char cwd[MAXPATHLEN];
#endif
SLS_FETCH();
PLS_FETCH();