Skip to content

Commit

Permalink
lib: fix gcc warning in printf call
Browse files Browse the repository at this point in the history
Do not pass NULL to printf %s.

Seen with gcc 13.2.0 on Debian:
```
.../curl/lib/connect.c:696:27: warning: '%s' directive argument is null [-Wformat-overflow=]
```
Ref: https://github.com/curl/curl-for-win/actions/runs/6476161689/job/17584426483#step:3:11104

Ref: curl#10284
Co-authored-by: Jay Satiro
Closes curl#12082
  • Loading branch information
vszakats committed Oct 13, 2023
1 parent 465f02b commit 4e57d0f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,11 +693,11 @@ static CURLcode is_connected(struct Curl_cfilter *cf,
result = CURLE_COULDNT_CONNECT;
for(i = 0; i < sizeof(ctx->baller)/sizeof(ctx->baller[0]); i++) {
struct eyeballer *baller = ctx->baller[i];
if(!baller)
continue;
CURL_TRC_CF(data, cf, "%s assess started=%d, result=%d",
baller?baller->name:NULL,
baller?baller->has_started:0,
baller?baller->result:0);
if(baller && baller->has_started && baller->result) {
baller->name, baller->has_started, baller->result);
if(baller->has_started && baller->result) {
result = baller->result;
break;
}
Expand Down

0 comments on commit 4e57d0f

Please sign in to comment.