@@ -486,22 +486,22 @@ PHP_METHOD(DOMXPath, quote) {
486
486
}
487
487
if (memchr (input , '\'' , input_len ) == NULL ) {
488
488
zend_string * const output = zend_string_safe_alloc (1 , input_len , 2 , false);
489
- output -> val [0 ] = '\'' ;
490
- memcpy (output -> val + 1 , input , input_len );
491
- output -> val [input_len + 1 ] = '\'' ;
492
- output -> val [input_len + 2 ] = '\0' ;
489
+ ZSTR_VAL ( output ) [0 ] = '\'' ;
490
+ memcpy (ZSTR_VAL ( output ) + 1 , input , input_len );
491
+ ZSTR_VAL ( output ) [input_len + 1 ] = '\'' ;
492
+ ZSTR_VAL ( output ) [input_len + 2 ] = '\0' ;
493
493
RETURN_STR (output );
494
494
} else if (memchr (input , '"' , input_len ) == NULL ) {
495
495
zend_string * const output = zend_string_safe_alloc (1 , input_len , 2 , false);
496
- output -> val [0 ] = '"' ;
497
- memcpy (output -> val + 1 , input , input_len );
498
- output -> val [input_len + 1 ] = '"' ;
499
- output -> val [input_len + 2 ] = '\0' ;
496
+ ZSTR_VAL ( output ) [0 ] = '"' ;
497
+ memcpy (ZSTR_VAL ( output ) + 1 , input , input_len );
498
+ ZSTR_VAL ( output ) [input_len + 1 ] = '"' ;
499
+ ZSTR_VAL ( output ) [input_len + 2 ] = '\0' ;
500
500
RETURN_STR (output );
501
501
} else {
502
502
smart_str output = {0 };
503
503
// need to use the concat() trick published by Robert Rossney at https://stackoverflow.com/a/1352556/1067003
504
- smart_str_appendl (& output , "concat(" , 7 );
504
+ smart_str_appendl (& output , ZEND_STRL ( "concat(" ) );
505
505
const char * ptr = input ;
506
506
const char * const end = input + input_len ;
507
507
while (ptr < end ) {
@@ -518,7 +518,7 @@ PHP_METHOD(DOMXPath, quote) {
518
518
smart_str_appendc (& output , ',' );
519
519
}
520
520
ZEND_ASSERT (ptr == end );
521
- output .s -> val [output .s -> len - 1 ] = ')' ;
521
+ ZSTR_VAL ( output .s ) [output .s -> len - 1 ] = ')' ;
522
522
RETURN_STR (smart_str_extract (& output ));
523
523
}
524
524
}
0 commit comments