Skip to content

Commit

Permalink
Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
Browse files Browse the repository at this point in the history
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
  • Loading branch information
dstogov committed Jun 21, 2016
1 parent 67e23f4 commit 1616038
Show file tree
Hide file tree
Showing 92 changed files with 261 additions and 257 deletions.
10 changes: 5 additions & 5 deletions Zend/zend.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ ZEND_TSRMLS_CACHE_EXTERN()

#ifdef HAVE_NORETURN
# ifdef ZEND_NORETURN_ALIAS
ZEND_COLD void zend_error_noreturn(int type, const char *format, ...) ZEND_NORETURN;
ZEND_COLD void zend_error_noreturn(int type, const char *format, ...) ZEND_NORETURN ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
# else
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...);
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
# endif
#else
# define zend_error_noreturn zend_error
Expand Down Expand Up @@ -267,9 +267,9 @@ extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len);
extern ZEND_API zend_string *(*zend_resolve_path)(const char *filename, int filename_len);

ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...);
ZEND_API ZEND_COLD void zend_type_error(const char *format, ...);
ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...);
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_API ZEND_COLD void zend_type_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2);
ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);

ZEND_COLD void zenderror(const char *error);

Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -3846,7 +3846,7 @@ ZEND_API void zend_update_property_ex(zend_class_entry *scope, zval *object, zen
EG(fake_scope) = scope;

if (!Z_OBJ_HT_P(object)->write_property) {
zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be updated", name, ZSTR_VAL(Z_OBJCE_P(object)->name));
zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be updated", ZSTR_VAL(name), ZSTR_VAL(Z_OBJCE_P(object)->name));
}
ZVAL_STR(&property, name);
Z_OBJ_HT_P(object)->write_property(object, &property, value, NULL);
Expand Down Expand Up @@ -4041,7 +4041,7 @@ ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zval *object, zend
EG(fake_scope) = scope;

if (!Z_OBJ_HT_P(object)->read_property) {
zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be read", name, ZSTR_VAL(Z_OBJCE_P(object)->name));
zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be read", ZSTR_VAL(name), ZSTR_VAL(Z_OBJCE_P(object)->name));
}

ZVAL_STR(&property, name);
Expand Down
14 changes: 3 additions & 11 deletions Zend/zend_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,6 @@ typedef struct _zend_mm_free_slot zend_mm_free_slot;
typedef struct _zend_mm_chunk zend_mm_chunk;
typedef struct _zend_mm_huge_list zend_mm_huge_list;

#ifdef _WIN64
# define PTR_FMT "0x%0.16I64x"
#elif SIZEOF_LONG == 8
# define PTR_FMT "0x%0.16lx"
#else
# define PTR_FMT "0x%0.8lx"
#endif

#ifdef MAP_HUGETLB
int zend_mm_use_huge_pages = 0;
#endif
Expand Down Expand Up @@ -2515,7 +2507,7 @@ ZEND_API char* ZEND_FASTCALL _estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_

length = strlen(s);
if (UNEXPECTED(length + 1 == 0)) {
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", 1, length, 1);
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (1 * %zu + 1)", length);
}
p = (char *) _emalloc(length + 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
if (UNEXPECTED(p == NULL)) {
Expand All @@ -2530,7 +2522,7 @@ ZEND_API char* ZEND_FASTCALL _estrndup(const char *s, size_t length ZEND_FILE_LI
char *p;

if (UNEXPECTED(length + 1 == 0)) {
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", 1, length, 1);
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (1 * %zu + 1)", length);
}
p = (char *) _emalloc(length + 1 ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
if (UNEXPECTED(p == NULL)) {
Expand All @@ -2547,7 +2539,7 @@ ZEND_API char* ZEND_FASTCALL zend_strndup(const char *s, size_t length)
char *p;

if (UNEXPECTED(length + 1 == 0)) {
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", 1, length, 1);
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (1 * %zu + 1)", length);
}
p = (char *) malloc(length + 1);
if (UNEXPECTED(p == NULL)) {
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array
* so we shut up about it. This allows the if (!defined('FOO')) { return; }
* approach to work.
*/
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare %s, because the name is already in use", zend_get_object_type(Z_OBJCE_P(lcname)), Z_STRVAL_P(lcname));
zend_error_noreturn(E_COMPILE_ERROR, "Cannot declare %s, because the name is already in use", zend_get_object_type(Z_OBJCE_P(lcname)));
}
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ ZEND_METHOD(exception, getTraceAsString)
}
ZEND_HASH_FOREACH_NUM_KEY_VAL(Z_ARRVAL_P(trace), index, frame) {
if (Z_TYPE_P(frame) != IS_ARRAY) {
zend_error(E_WARNING, "Expected array for frame %pu", index);
zend_error(E_WARNING, "Expected array for frame " ZEND_ULONG_FMT, index);
continue;
}

Expand Down
6 changes: 3 additions & 3 deletions Zend/zend_exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ZEND_API void zend_register_default_classes(void);
/* exception_ce NULL, zend_ce_exception, zend_ce_error, or a derived class
* message NULL or the message of the exception */
ZEND_API ZEND_COLD zend_object *zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code);
ZEND_API ZEND_COLD zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code, const char *format, ...);
ZEND_API ZEND_COLD zend_object *zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4);
ZEND_API ZEND_COLD void zend_throw_exception_object(zval *exception);
ZEND_API void zend_clear_exception(void);

Expand All @@ -68,8 +68,8 @@ extern ZEND_API void (*zend_throw_exception_hook)(zval *ex);
ZEND_API ZEND_COLD void zend_exception_error(zend_object *exception, int severity);

/* do not export, in php it's available thru spprintf directly */
size_t zend_spprintf(char **message, size_t max_len, const char *format, ...);
zend_string *zend_strpprintf(size_t max_len, const char *format, ...);
size_t zend_spprintf(char **message, size_t max_len, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 3, 4);
zend_string *zend_strpprintf(size_t max_len, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);

END_EXTERN_C()

Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,7 @@ static zend_always_inline zval *zend_fetch_dimension_address_inner(HashTable *ht
hval = zend_dval_to_lval(Z_DVAL_P(dim));
goto num_index;
case IS_RESOURCE:
zend_error(E_NOTICE, "Resource ID#%pd used as offset, casting to integer (%pd)", Z_RES_HANDLE_P(dim), Z_RES_HANDLE_P(dim));
zend_error(E_NOTICE, "Resource ID#%d used as offset, casting to integer (%d)", Z_RES_HANDLE_P(dim), Z_RES_HANDLE_P(dim));
hval = Z_RES_HANDLE_P(dim);
goto num_index;
case IS_FALSE:
Expand Down Expand Up @@ -1833,7 +1833,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z

if (UNEXPECTED(Z_STRLEN_P(container) < (size_t)((offset < 0) ? -offset : (offset + 1)))) {
if (type != BP_VAR_IS) {
zend_error(E_NOTICE, "Uninitialized string offset: %pd", offset);
zend_error(E_NOTICE, "Uninitialized string offset: " ZEND_LONG_FMT, offset);
ZVAL_EMPTY_STRING(result);
} else {
ZVAL_NULL(result);
Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_execute_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ ZEND_API ZEND_NORETURN void zend_timeout(int dummy) /* {{{ */
zend_set_timeout_ex(0, 1);
#endif

zend_error_noreturn(E_ERROR, "Maximum execution time of %pd second%s exceeded", EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s");
zend_error_noreturn(E_ERROR, "Maximum execution time of " ZEND_LONG_FMT " second%s exceeded", EG(timeout_seconds), EG(timeout_seconds) == 1 ? "" : "s");
}
/* }}} */

Expand Down Expand Up @@ -1205,7 +1205,7 @@ static void zend_timeout_handler(int dummy) /* {{{ */
error_filename = "Unknown";
}

zend_spprintf(&log_buffer, 0, "\nFatal error: Maximum execution time of %pd+%pd seconds exceeded (terminated) in %s on line %d\n", EG(timeout_seconds), EG(hard_timeout), error_filename, error_lineno);
zend_spprintf(&log_buffer, 0, "\nFatal error: Maximum execution time of " ZEND_LONG_FMT "+" ZEND_LONG_FMT " seconds exceeded (terminated) in %s on line %d\n", EG(timeout_seconds), EG(hard_timeout), error_filename, error_lineno);
write(2, log_buffer, strlen(log_buffer));
_exit(1);
}
Expand Down
6 changes: 3 additions & 3 deletions Zend/zend_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static zend_always_inline uint32_t zend_hash_check_size(uint32_t nSize)
if (nSize < HT_MIN_SIZE) {
nSize = HT_MIN_SIZE;
} else if (UNEXPECTED(nSize >= HT_MAX_SIZE)) {
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", nSize, sizeof(Bucket), sizeof(Bucket));
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", nSize, sizeof(Bucket), sizeof(Bucket));
}

#if defined(ZEND_WIN32)
Expand Down Expand Up @@ -189,7 +189,7 @@ static void ZEND_FASTCALL zend_hash_packed_grow(HashTable *ht)
{
HT_ASSERT(GC_REFCOUNT(ht) == 1);
if (ht->nTableSize >= HT_MAX_SIZE) {
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket), sizeof(Bucket));
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket), sizeof(Bucket));
}
ht->nTableSize += ht->nTableSize;
HT_SET_DATA_ADDR(ht, perealloc2(HT_GET_DATA_ADDR(ht), HT_SIZE(ht), HT_USED_SIZE(ht), ht->u.flags & HASH_FLAG_PERSISTENT));
Expand Down Expand Up @@ -869,7 +869,7 @@ static void ZEND_FASTCALL zend_hash_do_resize(HashTable *ht)
pefree(old_data, ht->u.flags & HASH_FLAG_PERSISTENT);
zend_hash_rehash(ht);
} else {
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%zu * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket) + sizeof(uint32_t), sizeof(Bucket));
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket) + sizeof(uint32_t), sizeof(Bucket));
}
}

Expand Down
12 changes: 12 additions & 0 deletions Zend/zend_long.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ typedef int32_t zend_off_t;
#ifdef ZEND_ENABLE_ZVAL_LONG64
# define ZEND_LONG_FMT "%" PRId64
# define ZEND_ULONG_FMT "%" PRIu64
# define ZEND_XLONG_FMT "%" PRIx64
# define ZEND_LONG_FMT_SPEC PRId64
# define ZEND_ULONG_FMT_SPEC PRIu64
# ifdef ZEND_WIN32
Expand Down Expand Up @@ -87,6 +88,7 @@ typedef int32_t zend_off_t;
# define ZEND_STRTOUL(s0, s1, base) strtoul((s0), (s1), (base))
# define ZEND_LONG_FMT "%" PRId32
# define ZEND_ULONG_FMT "%" PRIu32
# define ZEND_XLONG_FMT "%" PRIx32
# define ZEND_LONG_FMT_SPEC PRId32
# define ZEND_ULONG_FMT_SPEC PRIu32
# ifdef ZEND_WIN32
Expand Down Expand Up @@ -117,6 +119,16 @@ typedef int32_t zend_off_t;

static const char long_min_digits[] = LONG_MIN_DIGITS;

#ifdef _WIN64
# define ZEND_ADDR_FMT "0x%016I64x"
#elif SIZEOF_SIZE_T == 4
# define ZEND_ADDR_FMT "0x%08zx"
#elif SIZEOF_SIZE_T == 8
# define ZEND_ADDR_FMT "0x%016zx"
#else
# error "Unknown SIZEOF_SIZE_T"
#endif

#endif /* ZEND_LONG_H */

/*
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_vm_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -7548,7 +7548,7 @@ ZEND_VM_HANDLER(142, ZEND_YIELD_FROM, CONST|TMP|VAR|CV, ANY)
ZVAL_OBJ(&generator->values, &iter->std);
}
} else {
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
HANDLE_EXCEPTION();
}

Expand Down
8 changes: 4 additions & 4 deletions Zend/zend_vm_execute.h
Original file line number Diff line number Diff line change
Expand Up @@ -3925,7 +3925,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CONST_HANDLER(
ZVAL_OBJ(&generator->values, &iter->std);
}
} else {
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
HANDLE_EXCEPTION();
}

Expand Down Expand Up @@ -13002,7 +13002,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_TMP_HANDLER(ZE
ZVAL_OBJ(&generator->values, &iter->std);
}
} else {
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
HANDLE_EXCEPTION();
}

Expand Down Expand Up @@ -16949,7 +16949,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_VAR_HANDLER(ZE
ZVAL_OBJ(&generator->values, &iter->std);
}
} else {
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
HANDLE_EXCEPTION();
}

Expand Down Expand Up @@ -35670,7 +35670,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CV_HANDLER(ZEN
ZVAL_OBJ(&generator->values, &iter->std);
}
} else {
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables", 0);
zend_throw_error(NULL, "Can use \"yield from\" only with arrays and Traversables");
HANDLE_EXCEPTION();
}

Expand Down
4 changes: 2 additions & 2 deletions ext/bz2/bz2_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
/* How much memory to allocate (1 - 9) x 100kb */
zend_long blocks = zval_get_long(tmpzval);
if (blocks < 1 || blocks > 9) {
php_error_docref(NULL, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%pd)", blocks);
php_error_docref(NULL, E_WARNING, "Invalid parameter given for number of blocks to allocate. (" ZEND_LONG_FMT ")", blocks);
} else {
blockSize100k = (int) blocks;
}
Expand All @@ -389,7 +389,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
/* Work Factor (0 - 250) */
zend_long work = zval_get_long(tmpzval);
if (work < 0 || work > 250) {
php_error_docref(NULL, E_WARNING, "Invalid parameter given for work factor. (%pd)", work);
php_error_docref(NULL, E_WARNING, "Invalid parameter given for work factor. (" ZEND_LONG_FMT ")", work);
} else {
workFactor = (int) work;
}
Expand Down
8 changes: 4 additions & 4 deletions ext/calendar/calendar.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ PHP_FUNCTION(cal_info)


if (cal != -1 && (cal < 0 || cal >= CAL_NUM_CALS)) {
php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd.", cal);
php_error_docref(NULL, E_WARNING, "invalid calendar ID " ZEND_LONG_FMT ".", cal);
RETURN_FALSE;
}

Expand All @@ -333,7 +333,7 @@ PHP_FUNCTION(cal_days_in_month)
}

if (cal < 0 || cal >= CAL_NUM_CALS) {
php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd.", cal);
php_error_docref(NULL, E_WARNING, "invalid calendar ID " ZEND_LONG_FMT ".", cal);
RETURN_FALSE;
}

Expand Down Expand Up @@ -375,7 +375,7 @@ PHP_FUNCTION(cal_to_jd)
}

if (cal < 0 || cal >= CAL_NUM_CALS) {
php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd.", cal);
php_error_docref(NULL, E_WARNING, "invalid calendar ID " ZEND_LONG_FMT ".", cal);
RETURN_FALSE;
}

Expand All @@ -397,7 +397,7 @@ PHP_FUNCTION(cal_from_jd)
}

if (cal < 0 || cal >= CAL_NUM_CALS) {
php_error_docref(NULL, E_WARNING, "invalid calendar ID %pd", cal);
php_error_docref(NULL, E_WARNING, "invalid calendar ID " ZEND_LONG_FMT "", cal);
RETURN_FALSE;
}
calendar = &cal_conversion_table[cal];
Expand Down
4 changes: 2 additions & 2 deletions ext/fileinfo/fileinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ zend_function_entry finfo_class_functions[] = {

#define FINFO_SET_OPTION(magic, options) \
if (magic_setflags(magic, options) == -1) { \
php_error_docref(NULL, E_WARNING, "Failed to set option '%pd' %d:%s", \
php_error_docref(NULL, E_WARNING, "Failed to set option '" ZEND_LONG_FMT "' %d:%s", \
options, magic_errno(magic), magic_error(magic)); \
RETURN_FALSE; \
}
Expand Down Expand Up @@ -340,7 +340,7 @@ PHP_FUNCTION(finfo_open)

if (finfo->magic == NULL) {
efree(finfo);
php_error_docref(NULL, E_WARNING, "Invalid mode '%pd'.", options);
php_error_docref(NULL, E_WARNING, "Invalid mode '" ZEND_LONG_FMT "'.", options);
if (object) {
zend_restore_error_handling(&zeh);
if (!EG(exception)) {
Expand Down
4 changes: 2 additions & 2 deletions ext/ftp/php_ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ PHP_FUNCTION(ftp_set_option)
RETURN_TRUE;
break;
default:
php_error_docref(NULL, E_WARNING, "Unknown option '%pd'", option);
php_error_docref(NULL, E_WARNING, "Unknown option '" ZEND_LONG_FMT "'", option);
RETURN_FALSE;
break;
}
Expand Down Expand Up @@ -1525,7 +1525,7 @@ PHP_FUNCTION(ftp_get_option)
RETURN_BOOL(ftp->usepasvaddress);
break;
default:
php_error_docref(NULL, E_WARNING, "Unknown option '%pd'", option);
php_error_docref(NULL, E_WARNING, "Unknown option '" ZEND_LONG_FMT "'", option);
RETURN_FALSE;
break;
}
Expand Down
6 changes: 3 additions & 3 deletions ext/gd/gd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2809,14 +2809,14 @@ PHP_FUNCTION(imagecolorat)
if (im->tpixels && gdImageBoundsSafe(im, x, y)) {
RETURN_LONG(gdImageTrueColorPixel(im, x, y));
} else {
php_error_docref(NULL, E_NOTICE, "%pd,%pd is out of bounds", x, y);
php_error_docref(NULL, E_NOTICE, "" ZEND_LONG_FMT "," ZEND_LONG_FMT " is out of bounds", x, y);
RETURN_FALSE;
}
} else {
if (im->pixels && gdImageBoundsSafe(im, x, y)) {
RETURN_LONG(im->pixels[y][x]);
} else {
php_error_docref(NULL, E_NOTICE, "%pd,%pd is out of bounds", x, y);
php_error_docref(NULL, E_NOTICE, "" ZEND_LONG_FMT "," ZEND_LONG_FMT " is out of bounds", x, y);
RETURN_FALSE;
}
}
Expand Down Expand Up @@ -4850,7 +4850,7 @@ PHP_FUNCTION(imageaffinematrixget)
}

default:
php_error_docref(NULL, E_WARNING, "Invalid type for element %li", type);
php_error_docref(NULL, E_WARNING, "Invalid type for element " ZEND_LONG_FMT, type);
RETURN_FALSE;
}

Expand Down
Loading

0 comments on commit 1616038

Please sign in to comment.