Skip to content

Commit e1e275e

Browse files
committed
Fix mysqlnd printf modifiers
By moving the the standard macros...
1 parent 4d65d53 commit e1e275e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

ext/mysqlnd/mysqlnd_ps_codec.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, const u
7979
#if SIZEOF_ZEND_LONG==4
8080
if (uval > INT_MAX) {
8181
DBG_INF("stringify");
82-
tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, uval);
82+
tmp_len = sprintf((char *)&tmp, "%" PRIu64, uval);
8383
} else
8484
#endif /* #if SIZEOF_LONG==4 */
8585
{
8686
if (byte_count < 8 || uval <= L64(9223372036854775807)) {
8787
ZVAL_LONG(zv, (zend_long) uval); /* the cast is safe, we are in the range */
8888
} else {
8989
DBG_INF("stringify");
90-
tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, uval);
90+
tmp_len = sprintf((char *)&tmp, "%" PRIu64, uval);
9191
DBG_INF_FMT("value=%s", tmp);
9292
}
9393
}
@@ -109,7 +109,7 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, const u
109109
#if SIZEOF_ZEND_LONG==4
110110
if ((L64(2147483647) < (int64_t) lval) || (L64(-2147483648) > (int64_t) lval)) {
111111
DBG_INF("stringify");
112-
tmp_len = sprintf((char *)&tmp, MYSQLND_LL_SPEC, lval);
112+
tmp_len = sprintf((char *)&tmp, "%" PRIi64, lval);
113113
} else
114114
#endif /* SIZEOF */
115115
{

ext/mysqlnd/mysqlnd_result.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered, free_result)(MYSQLND_RES_BUFFERED * cons
246246
{
247247

248248
DBG_ENTER("mysqlnd_result_buffered::free_result");
249-
DBG_INF_FMT("Freeing "MYSQLND_LLU_SPEC" row(s)", set->row_count);
249+
DBG_INF_FMT("Freeing "PRIu64" row(s)", set->row_count);
250250

251251
mysqlnd_error_info_free_contents(&set->error_info);
252252

ext/mysqlnd/mysqlnd_statistics.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ mysqlnd_fill_stats_hash(const MYSQLND_STATS * const stats, const MYSQLND_STRING
205205
for (i = 0; i < stats->count; i++) {
206206
char tmp[25];
207207

208-
sprintf((char *)&tmp, MYSQLND_LLU_SPEC, stats->values[i]);
208+
sprintf((char *)&tmp, "%" PRIu64, stats->values[i]);
209209
add_assoc_string_ex(return_value, names[i].s, names[i].l, tmp);
210210
}
211211
}

ext/mysqlnd/mysqlnd_wireprotocol.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,7 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_ROW_BUFFER * row_buffer, zval *
16611661
if (Z_TYPE_P(current_field) == IS_LONG && !as_int_or_float) {
16621662
/* we are using the text protocol, so convert to string */
16631663
char tmp[22];
1664-
const size_t tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, (uint64_t) Z_LVAL_P(current_field));
1664+
const size_t tmp_len = sprintf((char *)&tmp, ZEND_ULONG_FMT, Z_LVAL_P(current_field));
16651665
ZVAL_STRINGL(current_field, tmp, tmp_len);
16661666
} else if (Z_TYPE_P(current_field) == IS_STRING) {
16671667
/* nothing to do here, as we want a string and ps_fetch_from_1_to_8_bytes() has given us one */

0 commit comments

Comments
 (0)