static PHP_INI_MH(OnChangeMemoryLimit)
{
if (new_value) {
- PG(memory_limit) = zend_atol(new_value->val, new_value->len);
+ PG(memory_limit) = zend_atol(new_value->val, (int)new_value->len);
} else {
PG(memory_limit) = 1<<30; /* effectively, no limit */
}
*/
static PHP_INI_MH(OnUpdateDisplayErrors)
{
- PG(display_errors) = (zend_bool) php_get_display_errors_mode(new_value->val, new_value->len);
+ PG(display_errors) = (zend_bool) php_get_display_errors_mode(new_value->val, (int)new_value->len);
return SUCCESS;
}
if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
tmp_value = (ini_entry->orig_value ? ini_entry->orig_value->val : NULL );
- tmp_value_length = ini_entry->orig_value->len;
+ tmp_value_length = (int)ini_entry->orig_value->len;
} else if (ini_entry->value) {
tmp_value = ini_entry->value->val;
- tmp_value_length = ini_entry->value->len;
+ tmp_value_length = (int)ini_entry->value->len;
} else {
tmp_value = NULL;
tmp_value_length = 0;
fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | O_WRONLY, 0644);
if (fd != -1) {
char *tmp;
- int len;
+ size_t len;
zend_string *error_time_str;
time(&error_time);
len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str->val, log_message, PHP_EOL);
#ifdef PHP_WIN32
php_flock(fd, 2);
-#endif
+ /* XXX should eventually write in a loop if len > UINT_MAX */
+ php_ignore_value(write(fd, tmp, (unsigned)len));
+#else
php_ignore_value(write(fd, tmp, len));
+#endif
efree(tmp);
zend_string_free(error_time_str);
close(fd);
int is_function = 0;
/* get error text into buffer and escape for html if necessary */
- buffer_len = vspprintf(&buffer, 0, format, args);
+ buffer_len = (int)vspprintf(&buffer, 0, format, args);
if (PG(html_errors)) {
replace_buffer = php_escape_html_entities(buffer, buffer_len, 0, ENT_COMPAT, NULL TSRMLS_CC);
efree(buffer);
buffer = replace_buffer->val;
- buffer_len = replace_buffer->len;
+ buffer_len = (int)replace_buffer->len;
}
/* which function caused the problem if any at all */
/* if we still have memory then format the origin */
if (is_function) {
- origin_len = spprintf(&origin, 0, "%s%s%s(%s)", class_name, space, function, params);
+ origin_len = (int)spprintf(&origin, 0, "%s%s%s(%s)", class_name, space, function, params);
} else {
- origin_len = spprintf(&origin, 0, "%s", function);
+ origin_len = (int)spprintf(&origin, 0, "%s", function);
}
if (PG(html_errors)) {
function++;
}
if (space[0] == '\0') {
- doclen = spprintf(&docref_buf, 0, "function.%s", function);
+ doclen = (int)spprintf(&docref_buf, 0, "function.%s", function);
} else {
- doclen = spprintf(&docref_buf, 0, "%s.%s", class_name, function);
+ doclen = (int)spprintf(&docref_buf, 0, "%s.%s", class_name, function);
}
while((p = strchr(docref_buf, '_')) != NULL) {
*p = '-';
int buf_len;
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, buf, PHP_WIN32_ERROR_MSG_BUFFER_SIZE, NULL);
- buf_len = strlen(buf);
+ buf_len = (int)strlen(buf);
if (buf_len >= 2) {
buf[buf_len - 1] = '\0';
buf[buf_len - 2] = '\0';
int buffer_len, display;
TSRMLS_FETCH();
- buffer_len = vspprintf(&buffer, PG(log_errors_max_len), format, args);
+ buffer_len = (int)vspprintf(&buffer, PG(log_errors_max_len), format, args);
/* check for repeated errors to be ignored */
if (PG(ignore_repeated_errors) && PG(last_error_message)) {
return;
}
- new_timeout_strlen = zend_spprintf(&new_timeout_str, 0, ZEND_LONG_FMT, new_timeout);
+ new_timeout_strlen = (int)zend_spprintf(&new_timeout_str, 0, ZEND_LONG_FMT, new_timeout);
key = zend_string_init("max_execution_time", sizeof("max_execution_time")-1, 0);
if (zend_alter_ini_entry_chars_ex(key, new_timeout_str, new_timeout_strlen, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == SUCCESS) {
int realfile_len;
if (expand_filepath(primary_file->filename, realfile TSRMLS_CC)) {
- realfile_len = strlen(realfile);
+ realfile_len = (int)strlen(realfile);
zend_hash_str_add_empty_element(&EG(included_files), realfile, realfile_len);
primary_file->opened_path = estrndup(realfile, realfile_len);
}