mirror of
https://github.com/curl/curl.git
synced 2026-07-30 00:18:02 +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
|
|
@ -149,7 +149,7 @@ static size_t SyncTime_CURL_WriteHeader(void *ptr, size_t size, size_t nmemb,
|
|||
int i;
|
||||
SYSTime.wMilliseconds = 500; /* adjust to midpoint, 0.5 sec */
|
||||
for(i = 0; i < 12; i++) {
|
||||
if(strcmp(MthStr[i], TmpStr2) == 0) {
|
||||
if(!strcmp(MthStr[i], TmpStr2)) {
|
||||
SYSTime.wMonth = (WORD)(i + 1);
|
||||
break;
|
||||
}
|
||||
|
|
@ -232,26 +232,26 @@ int main(int argc, const char *argv[])
|
|||
if(argc > 1) {
|
||||
int OptionIndex = 1;
|
||||
while(OptionIndex < argc) {
|
||||
if(strncmp(argv[OptionIndex], "--server=", 9) == 0)
|
||||
if(!strncmp(argv[OptionIndex], "--server=", 9))
|
||||
snprintf(conf.timeserver, sizeof(conf.timeserver) - 1, "%s",
|
||||
&argv[OptionIndex][9]);
|
||||
|
||||
if(strcmp(argv[OptionIndex], "--showall") == 0)
|
||||
if(!strcmp(argv[OptionIndex], "--showall"))
|
||||
ShowAllHeader = 1;
|
||||
|
||||
if(strcmp(argv[OptionIndex], "--synctime") == 0)
|
||||
if(!strcmp(argv[OptionIndex], "--synctime"))
|
||||
AutoSyncTime = 1;
|
||||
|
||||
if(strncmp(argv[OptionIndex], "--proxy-user=", 13) == 0)
|
||||
if(!strncmp(argv[OptionIndex], "--proxy-user=", 13))
|
||||
snprintf(conf.proxy_user, sizeof(conf.proxy_user) - 1, "%s",
|
||||
&argv[OptionIndex][13]);
|
||||
|
||||
if(strncmp(argv[OptionIndex], "--proxy=", 8) == 0)
|
||||
if(!strncmp(argv[OptionIndex], "--proxy=", 8))
|
||||
snprintf(conf.http_proxy, sizeof(conf.http_proxy) - 1, "%s",
|
||||
&argv[OptionIndex][8]);
|
||||
|
||||
if((strcmp(argv[OptionIndex], "--help") == 0) ||
|
||||
(strcmp(argv[OptionIndex], "/?") == 0)) {
|
||||
if(!strcmp(argv[OptionIndex], "--help") ||
|
||||
!strcmp(argv[OptionIndex], "/?")) {
|
||||
showUsage();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue