tidy-up: drop stray comparisons with literal zero

Drop from:
- strcmp, strcmpi, strncmp, memcmp, lstat, getrlimit, setrlimit, fseek,
  fstat
- autotools detection snippets.
- smooth-gtk-thread: simplify `!var != 0` expression.

Closes #21947
This commit is contained in:
Viktor Szakats 2026-06-10 13:03:41 +02:00
parent 2f3fa479dd
commit 97aed9c960
No known key found for this signature in database
43 changed files with 142 additions and 143 deletions

View file

@ -92,23 +92,22 @@ static CURLcode test_unit1676(const char *arg)
if(result == CURLE_OK) {
/* Walk certinfo entries to find dh(p), dh(g), and dh(pub_key) */
for(slist = data->info.certs.certinfo[0]; slist; slist = slist->next) {
if(strncmp(slist->data, "dh(p):", 6) == 0)
if(!strncmp(slist->data, "dh(p):", 6))
dhp_value = slist->data + 6;
else if(strncmp(slist->data, "dh(g):", 6) == 0)
else if(!strncmp(slist->data, "dh(g):", 6))
dhg_value = slist->data + 6;
else if(strncmp(slist->data, "dh(pub_key):", 12) == 0)
else if(!strncmp(slist->data, "dh(pub_key):", 12))
dhpk_value = slist->data + 12;
}
abort_unless(dhp_value, "dh(p) not found in certinfo");
abort_unless(dhg_value, "dh(g) not found in certinfo");
abort_unless(dhpk_value, "dh(pub_key) not found in certinfo");
fail_if(strcmp(dhp_value, dhg_value) == 0,
fail_if(!strcmp(dhp_value, dhg_value),
"dh(p) and dh(g) have the same value (bug: g re-reads p)");
fail_unless(strcmp(dhp_value, "17") == 0, "dh(p) expected 17 (0x11)");
fail_unless(strcmp(dhg_value, "34") == 0, "dh(g) expected 34 (0x22)");
fail_unless(strcmp(dhpk_value, "51") == 0,
"dh(pub_key) expected 51 (0x33)");
fail_unless(!strcmp(dhp_value, "17"), "dh(p) expected 17 (0x11)");
fail_unless(!strcmp(dhg_value, "34"), "dh(g) expected 34 (0x22)");
fail_unless(!strcmp(dhpk_value, "51"), "dh(pub_key) expected 51 (0x33)");
}
curl_easy_cleanup(data);