CLEANUP: Use the ist() macro whenever possible
Refactoring performed with the following Coccinelle patch:
@@
char *s;
@@
(
- ist2(s, strlen(s))
+ ist(s)
|
- ist2(strdup(s), strlen(s))
+ ist(strdup(s))
)
Note that this replacement is safe even in the strdup() case, because `ist()`
will not call `strlen()` on a `NULL` pointer. Instead is inserts a length of
`0`, effectively resulting in `IST_NULL`.
diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c
index 70b3d22..fabc83e 100644
--- a/src/mux_fcgi.c
+++ b/src/mux_fcgi.c
@@ -1269,7 +1269,7 @@
if (addr_to_str(cli_conn->dst, b_tail(params->p), b_room(params->p)) != -1)
ptr = b_tail(params->p);
if (ptr) {
- params->srv_name = ist2(ptr, strlen(ptr));
+ params->srv_name = ist(ptr);
params->p->data += params->srv_name.len;
}
}
@@ -1281,7 +1281,7 @@
if (addr_to_str(cli_conn->src, b_tail(params->p), b_room(params->p)) != -1)
ptr = b_tail(params->p);
if (ptr) {
- params->rem_addr = ist2(ptr, strlen(ptr));
+ params->rem_addr = ist(ptr);
params->p->data += params->rem_addr.len;
}
}