]> granicus.if.org Git - php/commitdiff
Fix mysqlnd printf modifiers
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 12 Jun 2019 10:42:53 +0000 (12:42 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 12 Jun 2019 11:17:25 +0000 (13:17 +0200)
By moving the the standard macros...

ext/mysqlnd/mysqlnd_ps_codec.c
ext/mysqlnd/mysqlnd_result.c
ext/mysqlnd/mysqlnd_statistics.c
ext/mysqlnd/mysqlnd_wireprotocol.c

index 940bcf7ec3b3dcf7dc7a59fea4272c222915aada..12edd9a2849546af495a3459f2decb5cc2d01de7 100644 (file)
@@ -79,7 +79,7 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, const u
 #if SIZEOF_ZEND_LONG==4
                if (uval > INT_MAX) {
                        DBG_INF("stringify");
-                       tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, uval);
+                       tmp_len = sprintf((char *)&tmp, "%" PRIu64, uval);
                } else
 #endif /* #if SIZEOF_LONG==4 */
                {
@@ -87,7 +87,7 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, const u
                                ZVAL_LONG(zv, (zend_long) uval); /* the cast is safe, we are in the range */
                        } else {
                                DBG_INF("stringify");
-                               tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, uval);
+                               tmp_len = sprintf((char *)&tmp, "%" PRIu64, uval);
                                DBG_INF_FMT("value=%s", tmp);
                        }
                }
@@ -109,7 +109,7 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, const u
 #if SIZEOF_ZEND_LONG==4
                if ((L64(2147483647) < (int64_t) lval) || (L64(-2147483648) > (int64_t) lval)) {
                        DBG_INF("stringify");
-                       tmp_len = sprintf((char *)&tmp, MYSQLND_LL_SPEC, lval);
+                       tmp_len = sprintf((char *)&tmp, "%" PRIi64, lval);
                } else
 #endif /* SIZEOF */
                {
index 5c6eeddd0b3083bd1b1a346e96b5b38dd083a275..0aa69a0d6148757797e9b1ac8c3253108b689a9c 100644 (file)
@@ -246,7 +246,7 @@ MYSQLND_METHOD(mysqlnd_result_buffered, free_result)(MYSQLND_RES_BUFFERED * cons
 {
 
        DBG_ENTER("mysqlnd_result_buffered::free_result");
-       DBG_INF_FMT("Freeing "MYSQLND_LLU_SPEC" row(s)", set->row_count);
+       DBG_INF_FMT("Freeing "PRIu64" row(s)", set->row_count);
 
        mysqlnd_error_info_free_contents(&set->error_info);
 
index 6103f7f93b84ecfdb5619805872b861788d81232..2058441254b57cea34562f6ec22d4de2a06ae968 100644 (file)
@@ -205,7 +205,7 @@ mysqlnd_fill_stats_hash(const MYSQLND_STATS * const stats, const MYSQLND_STRING
        for (i = 0; i < stats->count; i++) {
                char tmp[25];
 
-               sprintf((char *)&tmp, MYSQLND_LLU_SPEC, stats->values[i]);
+               sprintf((char *)&tmp, "%" PRIu64, stats->values[i]);
                add_assoc_string_ex(return_value, names[i].s, names[i].l, tmp);
        }
 }
index b56a92c15271654056d9fa987a132bb06d623b16..6ef48a4a7d1d892033188d87acdbfcfaaf197057 100644 (file)
@@ -1661,7 +1661,7 @@ php_mysqlnd_rowp_read_text_protocol_aux(MYSQLND_ROW_BUFFER * row_buffer, zval *
                                if (Z_TYPE_P(current_field) == IS_LONG && !as_int_or_float) {
                                        /* we are using the text protocol, so convert to string */
                                        char tmp[22];
-                                       const size_t tmp_len = sprintf((char *)&tmp, MYSQLND_LLU_SPEC, (uint64_t) Z_LVAL_P(current_field));
+                                       const size_t tmp_len = sprintf((char *)&tmp, ZEND_ULONG_FMT, Z_LVAL_P(current_field));
                                        ZVAL_STRINGL(current_field, tmp, tmp_len);
                                } else if (Z_TYPE_P(current_field) == IS_STRING) {
                                        /* nothing to do here, as we want a string and ps_fetch_from_1_to_8_bytes() has given us one */