@@ -83,7 +83,7 @@ static void dom_decoding_encoding_ctx_init(dom_decoding_encoding_ctx *ctx)
83
83
ctx -> decode_data = NULL ;
84
84
/* Set fast path on by default so that the decoder finishing is skipped if this was never initialised properly. */
85
85
ctx -> fast_path = true;
86
- (void ) lxb_encoding_encode_init (& ctx -> encode , ctx -> encode_data , ctx -> encoding_output , sizeof (ctx -> encoding_output ) / sizeof (lxb_char_t ));
86
+ (void ) lxb_encoding_encode_init (& ctx -> encode , ctx -> encode_data , ctx -> encoding_output , sizeof (ctx -> encoding_output ) / sizeof (* ctx -> encoding_output ));
87
87
(void ) lxb_encoding_encode_replace_set (& ctx -> encode , LXB_ENCODING_REPLACEMENT_BYTES , LXB_ENCODING_REPLACEMENT_SIZE );
88
88
}
89
89
@@ -389,7 +389,7 @@ static void dom_setup_parser_encoding_manually(const lxb_char_t *buf_start, cons
389
389
390
390
decoding_encoding_ctx -> decode_data = encoding_data ;
391
391
392
- (void ) lxb_encoding_decode_init (& decoding_encoding_ctx -> decode , decoding_encoding_ctx -> decode_data , decoding_encoding_ctx -> codepoints , sizeof (decoding_encoding_ctx -> codepoints ) / sizeof (lxb_codepoint_t ));
392
+ (void ) lxb_encoding_decode_init (& decoding_encoding_ctx -> decode , decoding_encoding_ctx -> decode_data , decoding_encoding_ctx -> codepoints , sizeof (decoding_encoding_ctx -> codepoints ) / sizeof (* decoding_encoding_ctx -> codepoints ));
393
393
(void ) lxb_encoding_decode_replace_set (& decoding_encoding_ctx -> decode , & replacement_codepoint , LXB_ENCODING_REPLACEMENT_BUFFER_LEN );
394
394
decoding_encoding_ctx -> fast_path = decoding_encoding_ctx -> decode_data == decoding_encoding_ctx -> encode_data ; /* Note: encode_data is for UTF-8 */
395
395
@@ -947,8 +947,8 @@ static zend_result dom_common_save(dom_output_ctx *output_ctx, const xmlDoc *doc
947
947
lxb_encoding_decode_t decode ;
948
948
lxb_char_t encoding_output [4096 ];
949
949
lxb_codepoint_t codepoints [4096 ];
950
- (void ) lxb_encoding_encode_init (& encode , encoding_data , encoding_output , sizeof (encoding_output ) / sizeof (lxb_char_t ));
951
- (void ) lxb_encoding_decode_init (& decode , decoding_data , codepoints , sizeof (codepoints ) / sizeof (lxb_codepoint_t ));
950
+ (void ) lxb_encoding_encode_init (& encode , encoding_data , encoding_output , sizeof (encoding_output ) / sizeof (* encoding_output ));
951
+ (void ) lxb_encoding_decode_init (& decode , decoding_data , codepoints , sizeof (codepoints ) / sizeof (* codepoints ));
952
952
if (encoding_data -> encoding == LXB_ENCODING_UTF_8 ) {
953
953
lxb_encoding_encode_replace_set (& encode , LXB_ENCODING_REPLACEMENT_BYTES , LXB_ENCODING_REPLACEMENT_SIZE );
954
954
} else {
0 commit comments