- Make all places use MAXPATHLEN in the same way. It includes the

terminating NULL.
This commit is contained in:
Andi Gutmans 2000-12-16 20:52:43 +00:00
parent 93a93c2429
commit 86a1cace27
6 changed files with 16 additions and 6 deletions

View File

@ -211,11 +211,21 @@ static PHP_MSHUTDOWN_FUNCTION(dba)
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();

View File

@ -259,7 +259,7 @@ PHP_FUNCTION(getcwd)
}
#if HAVE_GETCWD
ret = V_GETCWD(path,MAXPATHLEN-1);
ret = V_GETCWD(path, MAXPATHLEN);
#elif HAVE_GETWD
ret = V_GETWD(path);
/*

View File

@ -360,7 +360,7 @@ PHPAPI FILE *php_fopen_primary_script(void)
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 *php_strip_url_passwd(char *url)
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);

View File

@ -106,7 +106,7 @@ PHPAPI int php_checkuid(const char *filename, char *fopen_mode, int mode)
}
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;

View File

@ -203,7 +203,7 @@ php_phttpd_request_ctor(PHLS_D SLS_DC)
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 */

View File

@ -327,7 +327,7 @@ JNIEXPORT void JNICALL Java_net_php_servlet_send
zend_file_handle file_handle;
#ifndef VIRTUAL_DIR
char cwd[MAXPATHLEN+1];
char cwd[MAXPATHLEN];
#endif
SLS_FETCH();
PLS_FETCH();