Skip to content

Commit 70571b2

Browse files
committed
ext/standard/var: Minor refactoring
1 parent dd04ff7 commit 70571b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/standard/var.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,10 +786,10 @@ static inline void php_var_serialize_long(smart_str *buf, zend_long val) /* {{{
786786
}
787787
/* }}} */
788788

789-
static inline void php_var_serialize_string(smart_str *buf, char *str, size_t len) /* {{{ */
789+
static inline void php_var_serialize_string(smart_str *buf, const char *str, size_t len) /* {{{ */
790790
{
791791
char b[32];
792-
char *s = zend_print_long_to_buf(b + sizeof(b) - 1, len);
792+
char *s = zend_print_ulong_to_buf(b + sizeof(b) - 1, len);
793793
size_t l = b + sizeof(b) - 1 - s;
794794
char *res = smart_str_extend(buf, 2 + l + 2 + len + 2);
795795
res = zend_mempcpy(res, "s:", 2);
@@ -807,7 +807,7 @@ static inline bool php_var_serialize_class_name(smart_str *buf, zval *struc) /*
807807

808808
PHP_SET_CLASS_ATTRIBUTES(struc);
809809
size_t class_name_len = ZSTR_LEN(class_name);
810-
char *s = zend_print_long_to_buf(b + sizeof(b) - 1, class_name_len);
810+
char *s = zend_print_ulong_to_buf(b + sizeof(b) - 1, class_name_len);
811811
size_t l = b + sizeof(b) - 1 - s;
812812
char *res = smart_str_extend(buf, 2 + l + 2 + class_name_len + 2);
813813
res = zend_mempcpy(res, "O:", 2);

0 commit comments

Comments
 (0)