mirror of
https://github.com/curl/curl.git
synced 2026-08-26 10:23:31 +03:00
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:
parent
2f3fa479dd
commit
97aed9c960
43 changed files with 142 additions and 143 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue