← Commit list

a5c6a4067a

Viktor Szakats
Viktor Szakats
2026-03-02
SUCCESS Duration: 320s

Subject

clang-tidy: fix `readability-suspicious-call-argument`

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

.clang-tidy.yml+1 -0
@@ -39,6 +39,7 @@ Checks:
- readability-redundant-function-ptr-dereference
- readability-redundant-parentheses
- readability-redundant-preprocessor
+ - readability-suspicious-call-argument
- readability-uppercase-literal-suffix
CheckOptions:
lib/curlx/strerr.c+1 -3
@@ -44,7 +44,6 @@
static const char *get_winsock_error(int err, char *buf, size_t len)
{
VERBOSE(const char *p);
- VERBOSE(size_t alen);
if(!len)
return NULL;
@@ -221,8 +220,7 @@ static const char *get_winsock_error(int err, char *buf, size_t len)
default:
return NULL;
}
- alen = strlen(p);
- curlx_strcopy(buf, len, p, alen);
+ curlx_strcopy(buf, len, p, strlen(p));
return buf;
#endif
}
tests/libtest/cli_hx_download.c+6 -6
@@ -85,10 +85,10 @@ static size_t my_write_d_cb(char *buf, size_t nitems, size_t buflen,
void *userdata)
{
struct transfer_d *t = userdata;
- size_t blen = (nitems * buflen);
+ curl_off_t blen = nitems * buflen;
size_t nwritten;
- curl_mfprintf(stderr, "[t-%zu] RECV %zu bytes, "
+ curl_mfprintf(stderr, "[t-%zu] RECV %" CURL_FORMAT_CURL_OFF_T " bytes, "
"total=%" CURL_FORMAT_CURL_OFF_T ", "
"pause_at=%" CURL_FORMAT_CURL_OFF_T "\n",
t->idx, blen, t->recv_size, t->pause_at);
@@ -108,19 +108,19 @@ static size_t my_write_d_cb(char *buf, size_t nitems, size_t buflen,
return CURL_WRITEFUNC_PAUSE;
}
- nwritten = fwrite(buf, nitems, buflen, t->out);
- if(nwritten < blen) {
+ nwritten = fwrite(buf, buflen, nitems, t->out);
+ if(nwritten < nitems) {
curl_mfprintf(stderr, "[t-%zu] write failure\n", t->idx);
return 0;
}
- t->recv_size += (curl_off_t)nwritten;
+ t->recv_size += blen;
if(t->fail_at > 0 && t->recv_size >= t->fail_at) {
curl_mfprintf(stderr, "[t-%zu] FAIL by write callback at "
"%" CURL_FORMAT_CURL_OFF_T " bytes\n", t->idx, t->recv_size);
return CURL_WRITEFUNC_ERROR;
}
- return nwritten;
+ return (size_t)blen;
}
static int my_progress_d_cb(void *userdata,
tests/libtest/cli_hx_upload.c+6 -6
@@ -64,10 +64,10 @@ static size_t my_write_u_cb(char *buf, size_t nitems, size_t buflen,
void *userdata)
{
struct transfer_u *t = userdata;
- size_t blen = (nitems * buflen);
+ curl_off_t blen = nitems * buflen;
size_t nwritten;
- curl_mfprintf(stderr, "[t-%zu] RECV %zu bytes, "
+ curl_mfprintf(stderr, "[t-%zu] RECV %" CURL_FORMAT_CURL_OFF_T " bytes, "
"total=%" CURL_FORMAT_CURL_OFF_T ", "
"pause_at=%" CURL_FORMAT_CURL_OFF_T "\n",
t->idx, blen, t->recv_size, t->pause_at);
@@ -79,13 +79,13 @@ static size_t my_write_u_cb(char *buf, size_t nitems, size_t buflen,
return 0;
}
- nwritten = fwrite(buf, nitems, buflen, t->out);
- if(nwritten < blen) {
+ nwritten = fwrite(buf, buflen, nitems, t->out);
+ if(nwritten < nitems) {
curl_mfprintf(stderr, "[t-%zu] write failure\n", t->idx);
return 0;
}
- t->recv_size += (curl_off_t)nwritten;
- return nwritten;
+ t->recv_size += blen;
+ return (size_t)blen;
}
static size_t my_read_cb(char *buf, size_t nitems, size_t buflen,