diff options
author | Daniel Stenberg <daniel@haxx.se> | 2022-07-13 23:46:16 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-07-17 23:27:02 +0200 |
commit | 0e48ac1f99a370a8b378e8ca059525feb0bf74d3 (patch) | |
tree | 3e0bd2caacc4dee994879eddc64534cc70652c76 /tests/libtest/lib557.c | |
parent | 8d06af10fb843476988110832e787fa918491109 (diff) | |
download | curl-0e48ac1f99a370a8b378e8ca059525feb0bf74d3.tar.gz |
mprintf: make dprintf_formatf never return negative
This function no longer returns a negative value if the formatting
string is bad since the return value would sometimes be propagated as a
return code from the mprintf* functions and they are documented to
return the length of the output. Which cannot be negative.
Fixes #9149
Closes #9151
Reported-by: yiyuaner on github
Diffstat (limited to 'tests/libtest/lib557.c')
-rw-r--r-- | tests/libtest/lib557.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c index 9afc566b6..d9f5c4e63 100644 --- a/tests/libtest/lib557.c +++ b/tests/libtest/lib557.c @@ -1532,8 +1532,8 @@ static int test_weird_arguments(void) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, /* 10 11 */ 0, 1, 2, 3, 4, 5, 6, 7, 8); /* 9 */ - if(rc != -1) { - printf("curl_mprintf() returned %d and not -1!\n", rc); + if(rc) { + printf("curl_mprintf() returned %d and not 0\n", rc); errors++; } |