This reapplies ist.cocci across the whole src/ tree.
---
src/acme.c | 2 +-
src/haterm.c | 2 +-
src/htx.c | 6 ++----
src/tools.c | 2 +-
4 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/acme.c b/src/acme.c
index 2c662b588..bae7230bb 100644
--- a/src/acme.c
+++ b/src/acme.c
@@ -1978,7 +1978,7 @@ int acme_res_auth(struct task *task, struct acme_ctx
*ctx, struct acme_auth *aut
line[nmsg++] = ist(ctx->cfg->vars);
line[nmsg++] = ist("\"\n");
}
- if (auth->dns.ptr) {
+ if (isttest(auth->dns)) {
line[nmsg++] = ist("dns-01-record \"");
line[nmsg++] = ist2(dns_record->area,
dns_record->data);
line[nmsg++] = ist("\"\n");
diff --git a/src/haterm.c b/src/haterm.c
index 939e129a1..89d6d5ab5 100644
--- a/src/haterm.c
+++ b/src/haterm.c
@@ -476,7 +476,7 @@ static int hstream_build_http_help_resp(struct hstream *hs)
goto err;
}
- if (!htx_add_data_atonce(htx, ist2(HTTP_HELP, strlen(HTTP_HELP)))) {
+ if (!htx_add_data_atonce(htx, ist(HTTP_HELP))) {
TRACE_ERROR("unable to add payload to HTX message",
HS_EV_HSTRM_SEND, hs);
goto err;
}
diff --git a/src/htx.c b/src/htx.c
index c045df766..3584f9ffb 100644
--- a/src/htx.c
+++ b/src/htx.c
@@ -763,8 +763,7 @@ size_t htx_xfer(struct htx *dst, struct htx *src, size_t
count, unsigned int fla
switch (type) {
case HTX_BLK_DATA:
v = htx_get_blk_value(src, blk);
- if (v.len > max)
- v.len = max;
+ v = isttrim(v, max);
v.len = htx_add_data(dst, v);
if (!v.len) {
dst_full = 1;
@@ -910,8 +909,7 @@ struct htx_ret htx_xfer_blks(struct htx *dst, struct htx
*src, uint32_t count,
switch (type) {
case HTX_BLK_DATA:
v = htx_get_blk_value(src, blk);
- if (v.len > max)
- v.len = max;
+ v = isttrim(v, max);
v.len = htx_add_data(dst, v);
if (!v.len)
goto stop;
diff --git a/src/tools.c b/src/tools.c
index a83a46ac7..2687c2cdc 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -6970,7 +6970,7 @@ void update_word_fingerprint_with_len(uint8_t *fp, struct
ist word)
int c;
from = 28; // begin
- for (p = word.ptr; p < word.ptr + word.len; p++) {
+ for (p = word.ptr; p < istend(word); p++) {
c = tolower((unsigned char)*p);
switch(c) {
case 'a'...'z': to = c - 'a' + 1; break;
--
2.53.0