use buffer_string_set_length() to truncate strings
parent
c463860451
commit
df8032a7c8
|
@ -495,7 +495,7 @@ context ::= DOLLAR SRVVARNAME(B) LBRACKET stringop(C) RBRACKET cond(E) expressio
|
|||
}
|
||||
else {
|
||||
int rc;
|
||||
buffer_commit(rvalue, (size_t)(slash - rvalue->ptr)); /*(truncate)*/
|
||||
buffer_string_set_length(rvalue, (size_t)(slash - rvalue->ptr)); /*(truncate)*/
|
||||
rc = http_request_host_normalize(rvalue);
|
||||
buffer_append_string_len(rvalue, CONST_STR_LEN("/"));
|
||||
buffer_append_int(rvalue, (int)nm_bits);
|
||||
|
|
|
@ -302,7 +302,7 @@ int http_request_host_normalize(buffer *b) {
|
|||
if (1 != rc) return -1;
|
||||
|
||||
inet_ntop(AF_INET6,(const void *)&addr, buf, sizeof(buf));
|
||||
buffer_commit(b, 1); /* truncate after '[' */
|
||||
buffer_string_set_length(b, 1); /* truncate after '[' */
|
||||
buffer_append_string(b, buf);
|
||||
buffer_append_string_len(b, CONST_STR_LEN("]"));
|
||||
|
||||
|
|
Loading…
Reference in New Issue