mirror of
https://github.com/curl/curl.git
synced 2026-07-30 12:58:04 +03:00
tidy-up: syntax and code nits
- cmp-pkg-config.sh: replace `-r -f` with `-rf` to match rest of repo. - configure.ac: add double quotes for robustness (not a bug). - curl-openssl.m4: merge nested `if`s. - CurlTests.c: drop `!= 0`, also to sync with m4. - CurlTests.c: replace `example.com` with `localhost` in `gethostbyname()` feature test code. (compile-only, not a bug) - GHA/http3-linux: drop literal `true` from bool expression. - lib650: drop redundant `&`. - move variable/call to left-hand side of equality checks, where missing. - perl: detach `<`/`>` from filename in `open()`, where missing. - schannel: apply two nit fixes lost in rebase. - scripts/verify-release: drop redundant double quotes. - scripts/verify-release: exit with error code on error. - synctime: replace magic numbers with `sizeof()`. - telnet: add missing parentheses to macro value. - tests/Makefile.am: use single quotes. - tool_operate: drop redundant `break` after `return` in VMS code. - unit2413: drop unused NULL pointer + free call. - unit2413: fix duplicate test case name. - urlapi: drop redundant parentheses. - urlapi: drop `CURL_UNCONST()` that became redundant. Closes #22186
This commit is contained in:
parent
a36384ab94
commit
84c5dcdb05
31 changed files with 100 additions and 102 deletions
|
|
@ -33,8 +33,8 @@ use File::Copy;
|
|||
my $docroot = "https://curl.se/libcurl/c";
|
||||
|
||||
for my $f (@ARGV) {
|
||||
open(NEW, ">$f.new");
|
||||
open(F, "<$f");
|
||||
open(NEW, ">", "$f.new");
|
||||
open(F, "<", $f);
|
||||
while(<F>) {
|
||||
my $l = $_;
|
||||
if($l =~ /\/* $docroot/) {
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ int main(void)
|
|||
if(failed) {
|
||||
FILE *fp = fopen(t->logfile, "wb");
|
||||
|
||||
if(fp && t->log.len == fwrite(t->log.buf, 1, t->log.len, fp))
|
||||
if(fp && fwrite(t->log.buf, 1, t->log.len, fp) == t->log.len)
|
||||
fprintf(stderr, "Transfer log written to %s\n", t->logfile);
|
||||
else {
|
||||
fprintf(stderr, "Failed to write transfer log to %s: %s\n",
|
||||
|
|
|
|||
|
|
@ -300,7 +300,8 @@ int main(int argc, const char *argv[])
|
|||
/* Get current system time and local time */
|
||||
GetSystemTime(&SYSTime);
|
||||
GetLocalTime(&LOCALTime);
|
||||
snprintf(timeBuf, 60, "%s, %02d %s %04d %02d:%02d:%02d.%03d, ",
|
||||
snprintf(timeBuf, sizeof(timeBuf) - 1,
|
||||
"%s, %02d %s %04d %02d:%02d:%02d.%03d, ",
|
||||
DayStr[LOCALTime.wDayOfWeek], LOCALTime.wDay,
|
||||
MthStr[LOCALTime.wMonth - 1], LOCALTime.wYear, LOCALTime.wHour,
|
||||
LOCALTime.wMinute, LOCALTime.wSecond, LOCALTime.wMilliseconds);
|
||||
|
|
@ -314,7 +315,8 @@ int main(int argc, const char *argv[])
|
|||
|
||||
#if defined(_WIN32) && !defined(CURL_WINDOWS_UWP)
|
||||
GetLocalTime(&LOCALTime);
|
||||
snprintf(timeBuf, 60, "%s, %02d %s %04d %02d:%02d:%02d.%03d, ",
|
||||
snprintf(timeBuf, sizeof(timeBuf) - 1,
|
||||
"%s, %02d %s %04d %02d:%02d:%02d.%03d, ",
|
||||
DayStr[LOCALTime.wDayOfWeek], LOCALTime.wDay,
|
||||
MthStr[LOCALTime.wMonth - 1], LOCALTime.wYear, LOCALTime.wHour,
|
||||
LOCALTime.wMinute, LOCALTime.wSecond, LOCALTime.wMilliseconds);
|
||||
|
|
@ -329,7 +331,8 @@ int main(int argc, const char *argv[])
|
|||
else {
|
||||
/* Successfully re-adjusted computer clock */
|
||||
GetLocalTime(&LOCALTime);
|
||||
snprintf(timeBuf, 60, "%s, %02d %s %04d %02d:%02d:%02d.%03d, ",
|
||||
snprintf(timeBuf, sizeof(timeBuf) - 1,
|
||||
"%s, %02d %s %04d %02d:%02d:%02d.%03d, ",
|
||||
DayStr[LOCALTime.wDayOfWeek], LOCALTime.wDay,
|
||||
MthStr[LOCALTime.wMonth - 1], LOCALTime.wYear,
|
||||
LOCALTime.wHour, LOCALTime.wMinute, LOCALTime.wSecond,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue