- char cl_header_str[128];
- size_t cl_header_len;
- cl_header_len = snprintf(cl_header_str, sizeof(cl_header_str), "Content-Length: %zu", content_length);
- http_send_header_string_ex(cl_header_str, cl_header_len, 1);
+ phpstr header;
+
+ phpstr_init(&header);
+ phpstr_appendf(&header, "Content-Length: %zu", content_length);
+ phpstr_fix(&header);
+ http_send_header_string_ex(PHPSTR_VAL(&header), PHPSTR_LEN(&header), 1);
+ phpstr_dtor(&header);