if (apv && *apv) {
php_info_print_table_row(2, "Apache Version", apv);
}
- sprintf(tmp, "%d", MODULE_MAGIC_NUMBER);
+ snprintf(tmp, sizeof(tmp), "%d", MODULE_MAGIC_NUMBER);
php_info_print_table_row(2, "Apache API Version", tmp);
if (serv->server_admin && *(serv->server_admin)) {
php_info_print_table_row(2, "Server Administrator", serv->server_admin);
}
- sprintf(tmp, "%s:%u", serv->server_hostname, serv->port);
+ snprintf(tmp, sizeof(tmp), "%s:%u", serv->server_hostname, serv->port);
php_info_print_table_row(2, "Hostname:Port", tmp);
#if !defined(WIN32) && !defined(WINNT)
#if MODULE_MAGIC_NUMBER_MAJOR >= 20081201
- sprintf(tmp, "%s(%d)/%d", ap_unixd_config.user_name, ap_unixd_config.user_id, ap_unixd_config.group_id);
+ snprintf(tmp, sizeof(tmp), "%s(%d)/%d", ap_unixd_config.user_name, ap_unixd_config.user_id, ap_unixd_config.group_id);
#else
- sprintf(tmp, "%s(%d)/%d", unixd_config.user_name, unixd_config.user_id, unixd_config.group_id);
+ snprintf(tmp, sizeof(tmp), "%s(%d)/%d", unixd_config.user_name, unixd_config.user_id, unixd_config.group_id);
#endif
php_info_print_table_row(2, "User/Group", tmp);
#endif
ap_mpm_query(AP_MPMQ_MAX_REQUESTS_DAEMON, &max_requests);
- sprintf(tmp, "Per Child: %d - Keep Alive: %s - Max Per Connection: %d", max_requests, (serv->keep_alive ? "on":"off"), serv->keep_alive_max);
+ snprintf(tmp, sizeof(tmp), "Per Child: %d - Keep Alive: %s - Max Per Connection: %d", max_requests, (serv->keep_alive ? "on":"off"), serv->keep_alive_max);
php_info_print_table_row(2, "Max Requests", tmp);
apr_snprintf(tmp, sizeof tmp,
.B http://www.php.net/manual/
.PD 1
.P
-A nice introduction to PHP by Stig Bakken can be found here:
-.PD 0
-.P
-.B http://www.zend.com/zend/art/intro.php
-.PD 1
.SH BUGS
You can view the list of known bugs or report any new bug you
found at:
#include "zend_highlight.h"
#include "zend_indent.h"
-/* {{{ cli_is_valid_code
- */
typedef enum {
body,
sstring,
outside,
} php_code_type;
-int cli_is_valid_code(char *code, int len, char **prompt TSRMLS_DC)
+int cli_is_valid_code(char *code, int len, char **prompt TSRMLS_DC) /* {{{ */
{
int valid_end = 1, last_valid_end;
int brackets_count = 0;
efree(class_name);
}
if (pce && retval) {
- char *tmp = malloc(class_name_len + 2 + strlen(retval) + 1);
+ int len = class_name_len + 2 + strlen(retval) + 1;
+ char *tmp = malloc(len);
- sprintf(tmp, "%s::%s", (*pce)->name.s, retval);
+ snprintf(tmp, len, "%s::%s", (*pce)->name.s, retval);
free(retval);
retval = tmp;
}
return retval;
} /* }}} */
-/* {{{ cli_code_completion
- */
-char **cli_code_completion(const char *text, int start, int end)
+char **cli_code_completion(const char *text, int start, int end) /* {{{ */
{
return rl_completion_matches(text, cli_completion_generator);
}
*/
strcpy( static_cons_buf, "/C=" );
if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_C", static_variable_buf, &variable_len ) && static_variable_buf[0] ) {
- strcat( static_cons_buf, static_variable_buf );
+ strlcat( static_cons_buf, static_variable_buf, ISAPI_SERVER_VAR_BUF_SIZE);
}
- strcat( static_cons_buf, "/ST=" );
+ strlcat( static_cons_buf, "/ST=", ISAPI_SERVER_VAR_BUF_SIZE);
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_ST", static_variable_buf, &variable_len ) && static_variable_buf[0] ) {
- strcat( static_cons_buf, static_variable_buf );
+ strlcat( static_cons_buf, static_variable_buf, ISAPI_SERVER_VAR_BUF_SIZE );
}
php_register_variable( "SSL_CLIENT_DN", static_cons_buf, track_vars_array TSRMLS_CC );
strcpy( static_cons_buf, "/C=" );
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_I_C", static_variable_buf, &variable_len ) && static_variable_buf[0] ) {
- strcat( static_cons_buf, static_variable_buf );
+ strlcat( static_cons_buf, static_variable_buf, ISAPI_SERVER_VAR_BUF_SIZE );
}
- strcat( static_cons_buf, "/ST=" );
+ strlcat( static_cons_buf, "/ST=", ISAPI_SERVER_VAR_BUF_SIZE);
variable_len = ISAPI_SERVER_VAR_BUF_SIZE;
if( lpECB->GetServerVariable( lpECB->ConnID, "SSL_CLIENT_I_ST", static_variable_buf, &variable_len ) && static_variable_buf[0] ) {
- strcat( static_cons_buf, static_variable_buf );
+ strlcat( static_cons_buf, static_variable_buf, ISAPI_SERVER_VAR_BUF_SIZE );
}
php_register_variable( "SSL_CLIENT_I_DN", static_cons_buf, track_vars_array TSRMLS_CC );
}
#if defined(SIGXFSZ) && defined(SIG_IGN)
signal(SIGXFSZ, SIG_IGN);
#endif
+ /* let STDOUT function as STDERR,
+ just in case writing to STDOUT directly */
+ dup2( 2, 1 );
if ( LSAPI_InitRequest( &g_req, LSAPI_SOCK_FILENO ) == -1 ) {
return -1;